总选框:<input type="checkbox" class="all" name="all">

子选框:
<input class='sel' type='checkbox' class="sel" name='test' value="">




/**
             * 全选 反选
             */
            $(".all").bind("click",function(){
            $(".sel").prop("checked",$(this).prop("checked"));
            })
            $(".sel").bind("click",function(){
                var sel=$(".sel");
                var b=true;
                for(var i=0;i<sel.length;i++){
                    if(sel[i].checked==false){
                        b=false;
                        break;
                    }
                }
                $(".all").prop("checked",b);
            })

  

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2021-09-17
  • 2021-10-06
  • 2022-12-23
  • 2021-11-10
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2021-12-04
  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案