JSFiddle - React, Tailwind, and code Playground

by GolezTrol

HTML

<form id="myForm" action="" method="post">
   <input type="radio" id="radio1" name="myRadio" value="radio1">
   <label for="radio1">radio1</label>
   <input type="radio" id="radio2" name="myRadio" value="radio2">
   <label for="radio2">radio2</label>
   <input type="radio" id="radio3" name="myRadio" value="radio3" checked="checked">
  <label for="radio3">radio3</label>
  <input type="radio" id="radio4" name="myRadio" value="radio4">
   <label for="radio4">radio4</label>
</form>

CSS

input[type="radio"]:checked + label {
    color: red;
}

label {display:block}