Skip to content

Instantly share code, notes, and snippets.

@sassy
Created August 16, 2013 16:04
Show Gist options
  • Save sassy/6251168 to your computer and use it in GitHub Desktop.
Save sassy/6251168 to your computer and use it in GitHub Desktop.
SVG
<svg xmlns="http://www.w3.org/2000/svg" onload="func(evt)">
<script>
function func(evt) {
var ns = "http://www.w3.org/2000/svg";
var doc = evt.target.ownerDocument;
var circle = doc.createElementNS(ns, 'circle');
circle.setAttributeNS(null, 'cx', '100');
circle.setAttributeNS(null, 'cy', '100');
circle.setAttributeNS(null, 'r', '50');
doc.documentElement.appendChild(circle);
}
</script>
<rect x="10" y="10" width="100" height="100" />
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment