function CheckUncheckParents(srcChild, check) { var parentDiv = GetParentByTagName("div", srcChild); var parentNodeTable = parentDiv.previousSibling; if (parentNodeTable) { if (parentNodeTable.attachEvent && parentNodeTable.fireEvent) { if (!parentNodeTable.addEventListener && parentNodeTable.attachEvent && parentNodeTable.fireEvent) { parentNodeTable.attachEvent("onclick", function click() { var checkUncheckSwitch = check; var inpElemsInParentTable = parentNodeTable.getElementsByTagName("input"); if (inpElemsInParentTable.length > 0) { var parentNodeChkBox = inpElemsInParentTable[0]; if (checkUncheckSwitch) { parentNodeChkBox.checked = checkUncheckSwitch; } //do the same recursively CheckUncheckParents(parentNodeChkBox, checkUncheckSwitch); } }); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)