Skip to content

Instantly share code, notes, and snippets.

@shreyas-satish
Created July 1, 2011 13:23
Show Gist options
  • Save shreyas-satish/1058535 to your computer and use it in GitHub Desktop.
Save shreyas-satish/1058535 to your computer and use it in GitHub Desktop.
jQuery event fire when all boxes are checked
I have a table. 1st column is a column for checkboxes and 2nd column is normal data.
When I check a check a single box I get an alert due to the following function which is as expected.
//To catch events when check boxes are checked.
$('input:checkbox').live('change', function() {
alert("Checked!");
});
But when I check all checkboxes using the command below, I don't get the alert from the function above.
//This checks all the checkboxes
$('input:checkbox').attr('checked', true);
Where am I going wrong?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment