JSFiddle - React, Tailwind, and code Playground

by Tushar Jadhav

HTML

<form name="myForm" id="#myForm">
  <div>
    <p>
      <input type="checkbox" name="accept-t-and-c" /> I accept terms and conditions</p>
  </div>
  <div>
    <button type="submit" name="submit">Submit</button>
  </div>
</form>

JavaScript

const $document = $(document);
$document.ready(() => {
  $("input[type='checkbox']").on('change', function() {
    console.log("Checked Value 'is' :: ", $(this).is(':checked'));
    console.log("Checked Value 'prop' :: ", $(this).prop('checked'));
  })
})