How To Translate Svg Code To Javascript Code?
I learned here stackoverflow that you can dynamically insert svg element into an HTML file as follows. var svgnode = document.createElementNS('http://www.w3.org/2000/svg','svg');
Solution 1:
It's just the xlink:href
that's the problem and that needs to be in the xlink namespace:
use.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", "#path2");
The rest of the code will work fine in the non-namespaced form.
Post a Comment for "How To Translate Svg Code To Javascript Code?"