I have many checkboxes in my page and there is a select all checkbox which checks all the checkboxes. Somehow I want to emulate that click event of checkbox even if it's checked/unchecked through select all button. How can I do it?
You can use the jQuery .trigger() method. See http://api.jquery.com/trigger/
E.g.:
$('#foo').trigger('click');
Getting check status
var checked = $("#selectall").is(":checked");
Then for setting
$("input:checkbox").attr("checked",checked);
You can use .change() function too
E.g.:
$('form input[type=checkbox]').change(function() { console.log('hello') });