JSFiddle - React, Tailwind, and code Playground
by BramVanroy
HTML
<input type="radio" id="show1" name="group">
<label for="show1">Show</label>
<input type="radio" id="hide1" name="group" checked>
<label for="hide1">Hide</label>
JavaScript
$(document).ready(function () {
function checker() {
if ($('input#show1').is(':checked')) {
alert("show1 is checked");
}
}
checker();
$('input#show1').change(checker);
});