Hacker News new | past | comments | ask | show | jobs | submit login

A DOM node can have multiple children but only one parent. To go up the tree and check for a hit you simply call (in pseudocode) node.parent.isOK?.parent.isOK? etc. To go down the tree you have to not only choose your search strategy (depth-first, breadth-first) but also check a whole lot more nodes in the hope that you’ll find what you want.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: