Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Recursion In DOM

function walkTree(node) {
  if (node == null) //
    return;
  // do something with node
  for (var i = 0; i < node.childNodes.length; i++) {
    walkTree(node.childNodes[i]);
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Recursion #In #DOM
ADD COMMENT
Topic
Name
9+2 =