JSFiddle - React, Tailwind, and code Playground

HTML

<tr>
    <td>Yes
        <input type="radio" name="email" id="email" value="yes" />
    </td>
    <td></td>
    <td>No
        <input type="radio" name="email" id="email" value="no" checked="checked" />
    </td>
</tr>
<input type="button" value="submit" onclick="doIt()" style="width: 150px; height:30px" />

JavaScript

function doIt() {
      var emailopt = document.getElementsByName('email');
      for (i = 0; i < emailopt.length; i++) {
          if (emailopt[i].checked) {
              alert(emailopt[i].value)
          }
      }
  }