Created
May 3, 2017 12:13
-
-
Save surendrans/a298adedb944f429dd80d3f9fdc8d9c2 to your computer and use it in GitHub Desktop.
Select and Dselect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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