Converting the DOM element in a String
- by Hsm Sharique Hasan
I am working on svg. I made some shapes in svg using my javascript code. Now what i have to do is to get that code of svg which has been made as i draw some thing. i want to get that code in a form of string so for the sake of reuse or if can put that code in a .svg file it outputs the same what i made by myself using my javascript code.
Like My code made this
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="500" height="500" id="one">
<g id="container">
<rect id ="rect" x="0" y="0" width="0" height="0" fill="pink"
stroke="blue" stroke-width="2" />
</g>
Now what should i do to get all the code from to in a form of string and i can print that.