ningmengyu1013
<!-- 全选按钮 -->  
<label for="exampleInputEmail2">全选</label>
 <input type="checkbox" class="allAndNotAll">
 <!-- 单选框 -->                
<td><input type="checkbox" value="{{ data.id }}" name="product_bound_id" id="inlineCheckbox1"></td>
    <script>
        //实现全选与反选
        $(".allAndNotAll").click(function () {
            if ($(this).prop("checked")) {
                $("input[id=inlineCheckbox1]:checkbox").each(function () {
                    $(this).prop("checked", true);
                });
            } else {
                $("input[id=inlineCheckbox1]:checkbox").each(function () {
                    $(this).prop("checked", false);
                });
            }
        });
        //当其中不勾选某一个选项的时候,则去掉全选复选框
        $(":checkbox[id=inlineCheckbox1]").click(function () {
            $(".allAndNotAll").prop(\'checked\',
                $(":checkbox[id=inlineCheckbox1]").length == $(":checkbox[id=inlineCheckbox1]:checked").length);
        });
    </script>

 

分类:

技术点:

相关文章:

  • 2021-09-27
  • 2021-09-27
  • 2021-09-27
  • 2021-09-27
  • 2021-08-29
  • 2022-02-17
  • 2021-08-05
  • 2021-10-19
猜你喜欢
  • 2022-01-23
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案