I have simple HTML page with svg like this:
<div id="plan">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<g id="layer3">
<rect width="105.71429" height="80" x="351.42856" y="152.36218" id="rect1" style="fill:#008000"></rect>
<rect width="120" height="85.714287" x="500" y="389.50504" id="rect2" style="fill:#008000"></rect>
</g>
</svg>
</div>
How i can get the string:
<rect width="105.71429" height="80" x="351.42856" y="152.36218" id="rect1" style="fill:#008000"></rect>
from this svg. I can use jquery and jquery svg. I try:
$(document).ready(function() {
console.log($("#plan #rect1")[0]);
})
In console i take this string, but i must get string in variable like this:
var str = $("#plan #rect1")[0];
variable str is [object SVGRectElement] [enter link description here]1