var checked = document.getElementsByName("checked_c[]"); var checked_counts = 0; for(var i = 0; i < checked.length; i ++){ if(checked[i].checked){ checked_counts++; } }
checked_counts 即是统计复选框选中个数
时间: 2024-10-03 23:26:49
var checked = document.getElementsByName("checked_c[]"); var checked_counts = 0; for(var i = 0; i < checked.length; i ++){ if(checked[i].checked){ checked_counts++; } }
checked_counts 即是统计复选框选中个数