Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$(function () {
$("#selectall").click(function () {
$('.case').prop('checked', this.checked);
});
$(".case").click(function () {
if ($(".case").length == $(".case:checked").length) {
$("#selectall").prop("checked", true);
} else {
$("#selectall").prop("checked", false);
}
var sList = "";
$(".case:checked").each(function () {
sList += "(" + $(this).val() + "-" + (this.checked ? "checked" : "not checked") + ")";
});
$("#log").html(sList);
$("#s").html($(".case:checked").serialize());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.