I am generating a svg object in a html document using java script. Something like this:
mySvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
myPath = document.createElementNS("http://www.w3.org/2000/svg", "path");
mySvg.appendChild(myPath);
Is there a javascript command to extract what the resulting html code would be?
i.e.
"<svg>...<path>...</path>...</svg>"
I want to then save this part as a string variable.
Thanks, Wendy
Yeah…Put your svg tag into a div and then get the Html of that div.
And for the whole svg as an html, you can do this:
For the string: