7
rated 0 times
[
14]
[
7]
/ answers: 1 / hits: 17495
/ 14 Years ago, tue, april 20, 2010, 12:00:00
I want to add some style to head tag in html page using javascript.
var h = document.getElementsByTagName('head').item(0);
h.innerHTML += '<style>a{font-size:100px;}</style>';
But when I run this code in IE8 I see this error message:
Could not set the innerHTML property. Invalid target element for this operation.
Any ideas?
More From » html