I need to know when any checkbox on the page is checked:
e.g.
<input type="checkbox">
I tried this in Jquery
$('input type=["checkbox"]').change(function(){
alert('changed');
});
But it didn't work, any ideas?
I need to know when any checkbox on the page is checked:
e.g.
<input type="checkbox">
I tried this in Jquery
$('input type=["checkbox"]').change(function(){
alert('changed');
});
But it didn't work, any ideas?
If you want to use .on this works
jQuery('input[type=checkbox]').on('change', function() {
if (this.checked) {
console.log('checked');
}
});