Fire jQuery Event When Checkbox Is Checked Or Unchecked




Here we consider how to Fire jQuery Event When Checkbox Is Checked Or Unchecked. Lets start with one example here. Suppose we have a checkbox with ID chkID inside form as shown below.

Fire jQuery Event When Checkbox Is Checked Or Unchecked, jQuery Event When Checkbox Is Checked Or Unchecked, jQuery Event When Checkbox Is Checked, Check if Checkbox is unchecked, checkbox change event in jquery, jquery change event for Checkbox, Checkbox Change in Jquery, jQuery, Checkbox, how to detect checkbox checked or unchecked

Now how to detect when the checkbox is checked or unchecked in jQuery?. Here we can make use of jQuery change event. Find the checkbox and add change event to this as shown here.

$(function () {
         $("#chkID").change(function () {
                  if (this.checked) {
                            // Write your code here
                   }
          });
});




Inside change event, check whether checkbox is checked or not. And then write rest of them as per your requirement. That's all, by this way we can we can detect a change in checkbox state.