$("#lblContents :checkbox").each(function () { if (this.checked) { this.checked = false; ids =""; } else { this.checked = true; ids += $(this).attr("id") + ‘,‘; } });
$("#lblContents :checkbox").each(function () { this.checked = true; ids += $(this).attr("id") + ‘,‘; }); $("#lblContents :checkbox").each(function () { this.checked = false; ids += ‘‘; });
checkbox全选 反选 不选 并获取id的值
时间: 2024-12-15 14:56:26