JSFiddle - React, Tailwind, and code Playground
HTML
<input type="radio" id="one" name="test" checked="checked"><label for="one">one</label>
<input type="radio" id="two" name="test"> <label for="two">two</label>
<input type="checkbox" id="change_radio"> <label for="change_radio">check</label>
JavaScript
$("#change_radio").change(function () {
console.log("change");
if ($(this).is(":checked")) {
$("#one").attr("checked", false);
$("#two").attr("checked", "checked");
}
else {
$("#two").attr("checked", false);
$("#one").attr("checked", "checked");
}
});