As seen on gmail, when you click on the checkbox on table head it selects all checkboxes in the table. Simple, yet useful!
$('#selectAllCheckbox').click(function(){
if($(this).is(':checked')){
$(this).parents('table').find('input[type="checkbox"]').attr('checked', true);
}
else{
$(this).parents('table').find('input[type="checkbox"]').attr('checked', false);
}
});
$('#selectAllCheckbox').click(function(){
if($(this).is(':checked')){
$(this).parents('table').find('input[type="checkbox"]').attr('checked', true);
}
else{
$(this).parents('table').find('input[type="checkbox"]').attr('checked', false);
}
});
No comments:
Post a Comment