Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Select and Dselect
$(function(){
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.case').attr('checked', this.checked);
});
// if all checkbox are selected, check the selectall checkbox
// and viceversa
$(".case").click(function(){
if($(".case").length == $(".case:checked").length) {
$("#selectall").attr("checked", "checked");
} else {
$("#selectall").removeAttr("checked");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment