全选js代码:
<script> function CheckAll() { var checkall=document.getElementById("chk"); //chk全选按钮的id var checkid=document.getElementsByName(‘counts[]‘); //counts[]复选框的name if(checkall.checked==true){ for(var i=0;i<checkid.length;i++){ checkid[i].checked=true; } }else{ for(var i=0;i<checkid.length;i++){ checkid[i].checked=false; } } } </script>
时间: 2024-11-14 11:56:19