I have a few checkboxes that I would like to do a 'Select All' option for. Id or name for those checkboxes is 'chk1', 'chk2', chk3..... and the id for the selector checkbox is 'SelectAll'
$(document).ready(function () {
$('#SelectAll').click(function () {
$('input[name^="chk"]').attr("checked", this.checked);
})
})
the code works fine the first time I select and unselect but doesn't work after the subsequent clicks.. pls help.