Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <script>console.clear();</script>
<svg viewBox="0 0 400 200" xmlns="http://www.w3.org/2000/svg">
  <g id="myCircle" transform="translate(0,20)" onclick="console.log('click handler: ' + evt.currentTarget.parentNode.nodeName);">
    <script>
      console.log('from inside!? (seems to only happen once): ' + document.currentScript.parentNode.nodeName);
    </script>
    <text x="0" y="9" class="label">click me</text>
  </g>
  <use id="circle2" href="#myCircle" x="10" y="100" />
</svg>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers