Reputation: 1732
I have an svg image i.e img src="image.svg". how to make this tag to be converted to svg tags in browser. I just tried in image tag but browser renders it as image tag only not as svg
Upvotes: 0
Views: 184
Reputation: 3363
Instead of using img use <embed>
or <object>
tags and try either .contentDocument
or getSVGDocument()
to get the contents of the svg file.
See the source code of this link for a live example http://xn--dahlstrm-t4a.net/svg/html/get-embedded-svg-document-script.html
Upvotes: 2