I'm pulling a bit of html and css from a database, and it happens to contain a bit of css wrapped in a style tag. I then set some innerhtml to the string variable and display it.
The html is rendered properly, but ie will not display the content with the css - of course firefox will. Below is an abbreviated example of the code
var outputString = '<style type="text/css">.fontRed{color:red;}</style><span class="fontRed">red</span>'
I then set it to the innerHTML
document.getElementById('bilbo').innerHTML = outputString;
This displays properly (the color red) in FF, however does not in IE. Is there a character I need to escape for IE? The rest of the html works, and even inline styles work correctly in IE.
Any assistance would be most welcome.
Thanks
.fontRed {color:red;}completely misses the point of CSS.