Reputation: 2520
We have a need to step the entire tree of HTML elements and check each one for attribute and more.
We have JavaScript solution to move on each HTML element child and all their children. We want a native solution for that. any idea?
Upvotes: 0
Views: 665
Reputation: 2520
OK, we did find a solution! Amazing one, supported in ALL BROWSERS! see the browser support here.
TreeWalker is component native to ALL browser, exist since IE9 (yes!!!), and it just walks inside a tree of elements from Root element you gave it through entire tree and all it sub-elements untile it walking all of them.
hope it helped.
Upvotes: 4