I want to change the style tag after generating contents. How can I add style to the style tag? I tried using:
document.getElementById(\'style\').appendChil
A style element has no element children, as its content is by definition just text (as far as HTML is concerned). But this means that you can just append to its content using the innerHTML property. If your element has , then you write:
style
innerHTML
document.getElementById('foo').innerHTML += styleContents;