svg-to-html-polyfill

0.0.4 • Public • Published

svg-to-html-polyfill

Mirror for https://code.google.com/p/innersvg/ + some files to make the package available in npm and bower.

Introduction

This JavaScript library that provides innerHTML, outerHTML properties on all SVGElements.

innerHTML and outerHTML in a SVG document works in Chrome 6+, Safari 5+, Firefox 4+ and IE9+.

innerHTML and outerHTML in a HTML5 document works in Chrome 7+, Firefox 4+ and IE9+.

Doesn't work in Opera since the SVGElement interface is not exposed.

Sample Code

<g id="foo"/>

document.getElementId("foo").innerHTML = "<circle r='40' fill='green'/>";
document.getElementId("foo").outerHTML = "<g id="foo"><circle r='40' fill='green'/></g>";

License

Apache License, Version 2.0

Package Sidebar

Install

npm i svg-to-html-polyfill

Weekly Downloads

110

Version

0.0.4

License

Apache-2.0

Unpacked Size

56.6 kB

Total Files

10

Last publish

Collaborators

  • ravidasari