I have following function to select/Deselect all checkbox.
$(function () {
$("#selectall").click(function () {
$('.Employee').attr('checked', this.checked);
});
$(".Employee").click(function () {
if ($(".Employee").length == $(".Employee:checked").length) {
$("#selectall").attr("checked", "checked");
} else {
$("#selectall").removeAttr("checked");
}
});
});
Its working properly but i am able to select/deselect all for first time on page load, for second time i need to reload the page.Means its not giving multiple time select/deselect functionality.