Search code examples
javascripthtmladditionhead

How add html elements to head element of page using javascript? (Cross Browser -> such as IE)


How add html elements to head element of page using javascript? (show us both jQuery and javascrip, but js is so important)

There are some threads in stack about this, but none of show a way for html elements.

"<b>Test</b>"   

For example one of them is :

Append some HTML into the HEAD tag?

As you see it's about adding css to head not html codes.

How can I do that?


Solution

  • it is invalid to put <b> elements inside the head element..

    Allowed elements are found at http://www.w3.org/TR/html-markup/head.html (read the Permitted contents section and links)