I have the following:
for (var i = 0; i < children.length; i++){
if(hasClass(children[i], \"lbExclude\")){
children[i].parentNode.removeChild(ch
You can use BFS to find all the elements.
function(element) {
// [].slice.call() - HTMLCollection to Array
var children = [].slice.call(element.children), found = 0;
while (children.length > found) {
children = children.concat([].slice.call(children[found].children));
found++;
}
return children;
};
This function returns all the children's children of the element.