View Single Post

  #3 (permalink)  
Old 03-20-2004, 04:33 AM
Holger
Guest
 
Posts: n/a
Default Re: How to loop throught all the childrens of a group elemen

hi
according to peter sorotokin
Quote:
Do not use this API(NodeList::item) to loop through all the child nodes of an element. It is much more efficient to do this:
for( var ch = element.firstChild ; ch ; ch = ch.nextSibling )
{
...
}
i thought you might want to know.
Holger

Quote:
Originally Posted by Anonymous
Quote:
Originally Posted by chore_ashwin
I want to access all the child elements of a container element ex. <g>
and loop through them
Please help me
Look at childNodes in our tutorial
http://www.learnsvg.com/tutorial2/ex...childNodes.svg
If you want to get only true object, you have to test if child is object or only linefeed.
So your example will run in Batik, ASV and also Corel where only true objects are child.

Michel
[/quote]
Reply With Quote