JSFiddle - React, Tailwind, and code Playground

by Joe Cisneros

HTML

<form>
    <label><input type="radio" name="q" id="radio-a" value="A"> A</label>
    <label><input type="radio" name="q" id="radio-b" value="B"> B</label>
    <label><input type="radio" name="q" id="radio-c" value="C"> C</label>
    <a href="#" id="clear-button">Clear</a>
  </form>

JavaScript

document.getElementById('clear-button').addEventListener('click', function () {
      ["radio-a", "radio-b", "radio-c"].forEach(function(id) {
        document.getElementById(id).checked = false;
      });
      return false;
    });