$("#checkAll").on('click',function(){ //全选按钮
        var flag = this.checked;
        console.log(flag);
        $("input[name='check']").each(function(){
           this.checked = flag;
        })
    })

    $("input[name='check']").on('click',function(){//单个选择按钮
        var length = $("input[name='check']").length;
        var len = $("input[name='check']:checked").length;
        if(length == len){
            $("#checkAll").get(0).checked = true;
        }else{
            $("#checkAll").get(0).checked = false;
        }
    })

  

相关文章:

  • 2022-03-11
  • 2021-12-30
  • 2022-12-23
  • 2022-01-05
  • 2021-12-16
  • 2022-01-15
  • 2021-05-22
猜你喜欢
  • 2021-10-27
  • 2021-12-02
  • 2021-12-11
  • 2021-10-12
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案