Hi, Pramod-
Pramod Eligeti wrote:
|
[...]
| Now my problem is, i want to wipe of all the previous anchor elements
| attached to the root SVG element and generate new anchor elements and
| attach to the root SVG element.
|
| i mean is there any method in dom like get all the anchor elements and
| then i can remove these and add new elements.
To do this, you can use:
//return list of target node's children of this element type as objects
var allAnchors = SVGRoot.getElementsByTagName('a');
for ( var a = allAnchors.length; 0 <= a; a-- )
{
var eachAnchor = allAnchors.item( a );
eachAnchor.parentNode.removeChild( eachAnchor );
}
Note that you should go from the end of the list to the beginning, when
removing nodes. That's because a nodelist is live, so as you remove elements
from it, the next item on the list will move up to take its place, leaving
some elements behind and causing errors when you try to get later items.
If you don't want to remove them, but rather change their contents, you
could do that instead. If it's appropriate, it would even be faster than
creating new elements from scratch.
Regards-
Doug
------------------------ Yahoo! Groups Sponsor --------------------~-->
You can search right from your browser? It's easy and it's free. See how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/