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
This is intersting. If you are not using document.getElementById because you have no Id in the div tag and you do not know where the element appears in the array, i think there are a couple of options The createNodeIterator and treeWalker methods of the DOM level 2 Traversal would do the trick as you could filter out your target elements (div) and traverse through until you found it. (least i think thats how it works ;) ). I dont think this is implemented yet though in any browsers or if so then its only the very latest (shame as it would be very usefull) The other way i thought of was with the example below. It loops through to check for a specific tag type. It will start at your current element and work up through the elements until it matches the first target element (DIV).. (similar to Slime's, except that you dont need to specify a parent level) It will only work however, f the element you want to access (the Parent DIV in this case) is the first that the function comes to. If there were several divs (eg around your image) then it wouldnt work.. Any other tags would be ok and you could have ten tables nested and it would still find the target div. [url=http://www.digital-ocean.co.uk/xcode/parentNodes.html]heres the function[/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »