|
4/3 |
2007/5/11-14 [Computer/SW/Languages/JavaScript] UID:46586 Activity:nil |
5/10 Let's say I have the following DOM: node1 - (contains divs with name="subject", name="author", etc) node2 - (contains divs with name="subject", name="author", etc, and contains other recursive nodes too) ... ... Yes, 1 node can encapsulate other nodes. Is there a way in js/DOM to say "From nodeX, I want to fetch all of my immediate (non grandchildren) children with name='subject'"? \_ this looks like a job for xpath \_ You can look at the nextSibling property and look for the name yourself. |