I tried to add a style sheet to an SVG element, like this:
var theSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
var theStyle = document.createElementNS("http://www.w3.org/2000/svg", "style");
theSvg.appendChild(theStyle);
console.log("theStyle.sheet=", theStyle.sheet); // undefined, try adding svg to DOM
document.body.appendChild(theSvg);
console.log("theStyle.sheet=", theStyle.sheet); // still undefined
What am I supposed to do to get to the sheet node there in theStyle
?
There is a fiddle here: http://jsfiddle.net/XaV7D/2/