jquery listen for checkbox change code example
Example 1: jQuery checkbox changed event
$("#myCheckBoxID").change(function() {
if(this.checked) {
}else{
}
});
Example 2: checkbox click event jquery
$('input[type="checkbox"]').click(function(){
if($(this).is(":checked")){
$("#isClicked").val("Yes");
}
else if($(this).is(":not(:checked)")){
$("#isClicked").val("");
}
});
Example 3: jquery watch checkbox change
$('input[type="checkbox"]').change(function() {
alert ("The element with id " + this.id + " changed.");
});