Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts

    Single-level DOM collections

    Hmm, is there any way to get a collection, like that of elm.getElementsByTagName, but that does ONLY include children, not all decendant elements?

    Oh, I know how to do one myself, but what I wanted to achieve was the interactivity of the collection - if I add, remove or otherwise change the document structure, the collection is updated with the new structure.

    Anyone know if this is possible?
    (I know it is in moz, using getters, but I wanted to have a cross-browser version.)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    You could use a TreeWalker or NodeIterator (or even an XPathEvaluator), but only Mozilla supports TreeWalkers and DOM3 XPath...

  • #3
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Well, DOM3 standard, that moz so far is the only browser to implement, is still better than the moz proprietary getters and setters.

    Curious how I know DOM and DOM2 pretty well, but never had a look into DOM3...
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •