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