HTML5 support on older browsers

I was reading something about using JavaScript to allow support for HTML5 in older browsers. THe article has this code, but I don’t understand what it does or where it goes…

<!--[if lt IE 9]>
    document.createElement("header" );
    document.createElement("footer" );
    document.createElement("aside"  );
    document.createElement("nav"    );
    document.createElement("hgroup" ); 
    document.createElement("time"   );
     <strong>Warning !</strong>
     Because your browser does not support HTML5, some elements are created using JavaScript.
     Unfortunately your browser has disabled scripting. Please enable it in order to display this page.
1 Like


IE8 doesn’t recognise any of the new html5 elements and won’t apply styling to them by default unless you first create them with javascript. You should use the html5shiv for this as that is what it is designed for and will contain the full list of new elements.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.