Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<svg id="svg" width="500px" height="500px">
<g id="1">
<rect id="0" x="50" y="25" width="50px" height="50px" style="fill:blue;"/>
<rect id="2" x="110" y="125" width="50px" height="50px" style="fill:blue;"/>
</g>
<g id="2">
<circle id="2" cx="150" cy="50" r="40"  stroke-width="4"  />
<polygon id="3" points="200,10 250,190 160,210" style="stroke-width:1" />
</g>
</svg>
</body>
</html>
 
var arr = $.map($('svg *'), function(v){ return v.outerHTML; });
console.log(arr);
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers