Skip to content

Instantly share code, notes, and snippets.

Object.defineProperty(SVGElement.prototype, 'innerSVG', {
get: function() {
var $node, $temp;
$temp = document.createElement('div');
$node = this.cloneNode(true);
$temp.appendChild($node);
return $temp.innerHTML;
},
set: function(markup) {
var $element, $temp, _i, _len, _ref, _results;