复选框 全选 全不选 反选

//全选
$("input[type=checkbox]").attr("checked", true);
//全不选
$("input[type=checkbox]").attr("checked", false);
//反选(自己偶尔发现的^-^)
$("input[type=checkbox]").attr("checked", function () {return !this.checked });

原文地址:https://www.cnblogs.com/zhja/p/2757443.html