84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
How to determine that the checkboxes under all other brother elements of the clicked tr are checked?Please give me some advice!!!
闭关修行中......
var flag = false; $("tr").siblings().each(function () { // 所有兄弟节点 $(this).find("checkbox").each(function () { // 兄弟节点下面的所有checkbox // 如果只有一个的话直接写不用遍历了 if (this.checked === false) { flag = true; console.log('不是所有的checked都为true'); } }) }) if (!flag) { console.log('所有的checked都为true'); }
By querying parent-tr-siblings and then using for to judge
Get all tr, maintain an array, click to change the corresponding index status of the array, traverse the array to determine which ones are currently checked
By querying parent-tr-siblings and then using for to judge
Get all tr, maintain an array, click to change the corresponding index status of the array, traverse the array to determine which ones are currently checked