时间:2021-07-01 10:21:17 帮助过:57人阅读
$("#chkAll").click(function () { if (this.checked) { $("input[name='chkId']").each(function () { this.checked = true; }); } else { $("input[name='chkId']").each(function () { this.checked = false; }); } });
全选
window.onload = function () { $("#chkAll").click(function () { $("input[name='chkId']").attr("checked", this.checked); }); }