How to select all checkboxes while click on a checkbox after page load. For this my code is,
$('#selectall').click(function () {
if (this.checked) {
$(':checkbox').each(function () {
this.checked = true;
});
} else {
$(':checkbox').each(function () {
this.checked = false;
});
}
});
This code is not working because I think the checkboxes are appearing after page load. How can I resolve this problem?
Aucun commentaire:
Enregistrer un commentaire