全选反选

$("#sel-all").click(function(){  //点击全选按钮
            if($("input[type='checkbox']").attr("checked")=="checked"){
                $("input[type='checkbox']").attr("checked","true");
            }else{
                $("input[type='checkbox']").removeAttr("checked");
            }

        })
原文地址:https://www.cnblogs.com/xsffliu/p/8603076.html