标签:ntb xid 复选框 elements 点击 checked nbsp doc class
var box = document.getElementById("boxid"); var loves = document.getElementsByClassName("sel"); if(box.checked == false){//如果全选按钮不为选中 for (var i = 0; i < loves.length; i++) { loves[i].checked = false;//将所有复选框设置为不选中 } }else{ for (var i = 0; i < loves.length; i++) {//否则将所有复选框设置为选中 loves[i].checked = true; } }
标签:ntb xid 复选框 elements 点击 checked nbsp doc class
原文地址:https://www.cnblogs.com/niushuangmeng/p/12684432.html