Here the concern is how to check a single checkbox is checked or not in jQuery.
Its very simple, we have to use the prop() method to achieve this. See the below example
1 2 3 4 5 6 7 8 9 10 11 12 | <script> $(document).ready(function(){ $('input[type="checkbox"]').click(function(){ if($(this).prop("checked") == true){ console.log("Checkbox is checked."); } else if($(this).prop("checked") == false){ console.log("Checkbox is unchecked."); } }); }); </script> |