JSFiddle - React, Tailwind, and code Playground

by Faron Ledger

HTML

<form action="" method="get">
<label><input name="Government" type="checkbox" value="">Government</label>
<br>
<label>
<input name="Parent" type="checkbox" id="parent_child_group" value="">Parent</label>
<br><label>Name of Child
    <input type="text" name="parent_child" value="" class="parent_child_group">
    </label>
  <br>
  <label>Other
    <input type="text" name="parent_other" value="" class="parent_child_group">
    </label>
</form>

JavaScript

$(function() {
  enable_cb();
  $("#parent_child_group").click(enable_cb);
});

function enable_cb() {
  if (this.checked) {
    $("input.parent_child_group").removeAttr("disabled");
  } else {
    $("input.parent_child_group").attr("disabled", true);
  }
}