Accessing DOM by another DOM

Discuss SVG code, accessible via the XML Editor.
katun89
Posts: 12
Joined: Sat Jan 08, 2011 12:57 pm

Accessing DOM by another DOM

Postby katun89 » Sun Jan 09, 2011 11:33 am

My document is shaped this way:


Guest

Re: Accessing DOM by another DOM

Postby Guest » Tue Jan 18, 2011 5:33 am

For me this works in most browsers that accept embedded SVGs:

Code: Select all

var SVG_DOM = document.getElementById('id_of_embedded_svg_element').getSVGDocument().documentElement;

Thereafter you can use standard DOM methods on this SVG_DOM object like getElementsById, getElementsByTagName, etc.


Return to “SVG / XML Code”