OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
multiple parentNode (s)
This page's ID:
10799
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Hmm, I'm not sure if there *is* a much more elegant solution. XPath would certainly be helpful here... =) But let's see if there's anything in the DOM Technical Reports ( [url=http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/]http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/[/url] )... Ugh... doesn't look like there is anything. Well, you can always make a function like this: function getAncestorAtLevel(thenode,level) { for (var a=0; a<level; a++) { thenode = thenode.parentNode; } return thenode; } Which can be used like getAncestorAtLevel(this,9) But that's the best I can really come up with...
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »