How To Detect User Has Checked Or Unchecked A Checkbox In JavaScript

Hello devs, do you know How to detect that a user has unchecked a checkbox or checked a check box by clicking? Sometimes we need to show some data after clicking a checkbox or hiding some data after clicking a checkbox.

In this example i will show you that how to detect check uncheck in checkbox jquery javascript. I will simply show you the source code of detect checkbox checked unchecked with jquery. I will use  jQuery prop() method to check or uncheck a checkbox dynamically.

Example code : 

$("input[type=checkbox]").click(function() {
   if ($(this).prop("checked")) {


Read also : How to Make the Window Full Screen with JavaScript


Hope it can help you.


#javascript #jquery