The code below throws the error Error: Unexpected call to method or property access
when I create a style elemnt and attempt to append the code to it:
//This is OK
var styleElement = document.createElement("style");
//This is OK
styleElement.type = "text/css";
//THIS THROWS THE ERROR
styleElement.appendChild(document.createTextNode("a { color: red; }"));
What am I doing wrong?