Access an element that is present in a embed object
-
Hello, I have the following file called index.html
and this code in another file called test.svg
<svg width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg"><rect id="mytestrectangle" width="300" height="100"
style="fill:rgb(255,0,255);stroke-width:1;
stroke:rgb(0,0,255);fill-opacity:0.9;"/><polygon points="0,0 100,100 170,250 20,10"
style="fill:#cccccc;
stroke:#000000;stroke-width:1"/></svg>
now what i am tring to do is from the file index.html try to access the element called "mytestrectangle" that is in the file test.svg. But I am incliding this file in index.html via the embed object. Is there a way I can access that element via javascript from the index.html page?
hope i expained clear what i need.
Thank you in advance for the help.
-
Hello, I have the following file called index.html
and this code in another file called test.svg
<svg width="100%" height="100%"
xmlns="http://www.w3.org/2000/svg"><rect id="mytestrectangle" width="300" height="100"
style="fill:rgb(255,0,255);stroke-width:1;
stroke:rgb(0,0,255);fill-opacity:0.9;"/><polygon points="0,0 100,100 170,250 20,10"
style="fill:#cccccc;
stroke:#000000;stroke-width:1"/></svg>
now what i am tring to do is from the file index.html try to access the element called "mytestrectangle" that is in the file test.svg. But I am incliding this file in index.html via the embed object. Is there a way I can access that element via javascript from the index.html page?
hope i expained clear what i need.
Thank you in advance for the help.
Well, I do not found any way to access elements that reside in file you have used in embed tag. However, you can access embed object as whole like
A Circle A Square <!-- document.write(document.embeds.length," embedded objects."); //or you can access specific element like //if you want to access embed object circle then you can use //document.embeds\[0\] or document.embeds\["circle"\] -->
HTH
Jinal Desai - LIVE Experience is mother of sage....
-
Well, I do not found any way to access elements that reside in file you have used in embed tag. However, you can access embed object as whole like
A Circle A Square <!-- document.write(document.embeds.length," embedded objects."); //or you can access specific element like //if you want to access embed object circle then you can use //document.embeds\[0\] or document.embeds\["circle"\] -->
HTH
Jinal Desai - LIVE Experience is mother of sage....