-
Notifications
You must be signed in to change notification settings - Fork 0
DOM traversal techniques node API
Rayhan Uddin edited this page Jun 2, 2017
·
2 revisions
Walk in html dom with recursive function.
TraversDomTree(node){
console.log(node);
for(node=node.firstChild;node!=null;node=node.nextSibling){
TraversDomTree(node);
}
}
To Implement,
TraversDomTree(document);
OR
TraversDomTree(div);
OR
TraversDomTree(ul);
OR
var node= Document.getElementById('idname');
TraversDomTree(node);