Last active
August 29, 2015 14:20
-
-
Save suntong/91fae43535138b9d25e5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 () { | |
$("#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