I have the following:
for (var i = 0; i < children.length; i++){
if(hasClass(children[i], \"lbExclude\")){
children[i].parentNode.removeChild(ch
If you have jquery and you want to get all descendant elements you can use:
var all_children= $(parent_element).find('*');
Just be aware that all_children
is an HTML collection and not an array. They behave similarly when you're just looping, but collection doesn't have a lot of the useful Array.prototype
methods you might otherwise enjoy.