JSFiddle - React, Tailwind, and code Playground

by vishal pandey

HTML

<label for="myCheckBox">
  I agree with terms and conditions
  <input type="checkbox" id="myCheckBox" />
</label>
<br />
<br />
<input type="button" id="myButton" value="Submit" disabled />

JavaScript

$(document).ready(function() {
   $('#myCheckBox').on('change', function() {
     var x = $(this).attr('value');
     if($(this).is(':checked')) {
       $('#myButton').prop('disabled','');
     } else {
       $('#myButton').prop('disabled','disabled');
     }
   });
 });