JavaScript的一个checkbox全选功能方法
[ 2021-11-03 15:21:03 | 作者: admin ]
<input type="checkbox" onclick="selectAll(this)" />全选
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=2806
<script>
function selectAll(selectAllBtn){
var arr=document.getElementsByName("choice");
for(var i=0;i<arr.length;i++){
arr[i].checked=selectAllBtn.checked;//循环遍历看是否全选
}
}
</script>
function selectAll(selectAllBtn){
var arr=document.getElementsByName("choice");
for(var i=0;i<arr.length;i++){
arr[i].checked=selectAllBtn.checked;//循环遍历看是否全选
}
}
</script>

这篇日志没有评论。
此日志不可发表评论。