JSFiddle - React, Tailwind, and code Playground
HTML
<input type="radio" name="sex" value="Male">Male</input>
<input type="radio" name="sex" value="Female">Female</input>
<br/><br/> Buttons for Radio Selection<br/>
<input type='button' value='Select Male' id='selectMale'>
<input type='button' value='Select Female' id='selectFemale'>
JavaScript
$("#selectMale").click(function () {
$('input:radio[name=sex]:nth(0)').attr('checked',true);
alert($('input:radio[name=sex]:checked').val());
});
$("#selectFemale").click(function () {
$('input:radio[name=sex]:nth(1)').attr('checked',true);
alert($('input:radio[name=sex]:checked').val());
});