JSFiddle - React, Tailwind, and code Playground

by chetfarley

HTML

<div> 
<input type="radio" name="check" id="one"><label for="one">On</label>
<input type="radio" name="check" id="two"><label for="two">Off</label>
</div>
    
<div>   
<input type="radio" name="check" id="thr"><label for="thr">On</label>
<input type="radio" name="check" id="fou"><label for="fou">Off</label>
</div>

CSS

.checked {font-weight: bold;}

JavaScript

$("input[type='radio']").click(function() {
    $("in)
    $(this).next("label").toggleClass("checked", this.checked);
});