A quick tip on how to enable HTML5 elements such as <section> and <header> in Internet Explorer. I’m afraid it does require Javascript:
document.createElement("section")
This workaround for all unrecognised HTML5 elements is available in the form of a tiny 352 bite JS file, from Google Code (uploaded here for your convenience!)
If only it were that easy!
There is one major caveat to this tip, in that I haven’t yet found a way to nest HTML5 elements reliably. This means that there is currently no way to make IE understand this markup:
<section><header></header></section>
As usual, where Internet Explorer is concerned, things are even more convoluted. IE recognises the new elements as XML rather than HTML. This shouldn’t be a major problem, but knowing this helps to avoid potential .nodeName headaches!
Tags: html5, internet explorer, javascript
Home
