Traversing nodes correctly - javascript childNodes
问题 I am trying to make following piece of code to work for each child node once. THe function is also deleting the node as per logic, for more than one child node it never seems to traverse to each child node. //Deleting from child node var target =document.getElementById(element.name).childNodes[0]; if(target.hasChildNodes()) { var children = new Array(); children = target.childNodes; for(child in children) { if(children[child].tagName == 'DIV'){ //target.removeChild[child]; var deleteChild =