checkbox on change function 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: checkbox change event javascript
document.getElementById('one').addEventListener('click', function(){
var two = document.getElementById('two');
two.checked = ! two.checked;
two.dispatchEvent('change');
});