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