I am trying to select all checkboxes on a page once the \'select all\' checkbox is clicked and i am using jquery for this as you can see at the below link:
http://js
Assume parent checkbox has a class of mainselect and all child have class of childselect
Then selecting parent will select all checkbox and vice-versa with the code below:
$('#mainselect').live('change',function(){
if($(this).attr('checked') == 'checked') {
$('.childselect').attr('checked','checked');
} else {
$('.childselect').removeAttr('checked');
}
});