Skip to content

Instantly share code, notes, and snippets.

@orhanveli
Created November 14, 2011 20:43
Show Gist options
  • Save orhanveli/1365091 to your computer and use it in GitHub Desktop.
Save orhanveli/1365091 to your computer and use it in GitHub Desktop.
asp:checkbox check all checkboxes using jQuery
// Checks all individual checkboxes
$(".checkAreaAll").children("input").click(function () {
$(".checkArea").children("input").attr('checked', $(".checkAreaAll").children("input").is(':checked'));
});
// unchecks the check all checkbox when one individual checkbox is unchecked
$(".checkArea").children("input").click(function () {
$(".checkAreaAll").children("input").attr('checked', false);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment