input type="checkbox" id="showcheckbox" class="checkbox" name="ArchivesId"
$("#btnshow").click(function () {
$("input[name='ArchivesId']").each(function () {
if ($(this).attr("checked")) {
$(this).removeAttr("checked");
}
else {
$(this).attr("checked", "true");
}
})
})
js选中第一次全选取消反选都可以第二次就无效了
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
6条回答 默认 最新
jasondyoung 2017-10-18 07:46关注$(this).removeAttr("checked");你这里别用移除,用$(this).attr("checked", "false");
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报