I'm trying to add some styles into a page using javascript
var style = document.createElement("style"),
style.innerHTML = ".firstChildTest div:first-child {width: 2px;}";
But ie6-8 are throwing an error when trying to use innerHTML on a style element. I also get the same error using
style.append(document.createTextNode(".firstChildTest div:first-child {width: 2px;}"));
How do I inject styles into a style element in ie?