html代码

<th><input type="checkbox" onclick="selectAll(this);" />全选/取消</th>

js代码(前提是引用了jquery)

<script type="text/javascript">
        function selectAll(checkbox) {
            $('input[type=checkbox]').prop('checked', $(checkbox).prop('checked'));
        }
</script>

 

相关文章:

  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-01-10
  • 2021-06-26
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2021-12-30
  • 2022-12-23
  • 2021-12-16
  • 2021-12-29
相关资源
相似解决方案