这段代码非常简单实用,通过链接切换所有checkbox是否选中
var tog = false; // or true if they are checked on load
$('a').click(function() {
$("input[type=checkbox]").attr("checked",!tog);
tog = !tog;
});
这段代码非常简单实用,通过链接切换所有checkbox是否选中
var tog = false; // or true if they are checked on load
$('a').click(function() {
$("input[type=checkbox]").attr("checked",!tog);
tog = !tog;
});