I am trying to add a use
-svg-tag with Javascript. Jakob Jenkov has an excellent intro to use
here: http://tutorials.jenkov.com/svg/use-element.html
I just tried to do the same thing with JavaScript:
var useit = document.createElementNS("http://www.w3.org/2000/svg", "use");
useit.setAttribute("xlink:href", "#a-circle");
useit.setAttribute("x", "100");
useit.setAttribute("y", "100");
svg.appendChild(useit);
I made a fiddle for it: http://jsfiddle.net/yfmSm/2/
Looking at the structure created (in Google Chrome workspace) everything looks fine to me. It is just that the circle added with use
is invisible.
What did I miss?