Skip to main content
Home / Code Snippets / JavaScript / Make HTML5 Elements Work in Old IE

Make HTML5 Elements Work in Old IE

So that the DOM (and thus CSS) recognizes them as real elements:

(function(){if(!/*@[email protected]*/0)return;var e = "abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while(i--){document.createElement(e[i])}})()

Hotlink Script:

<!--[if IE]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<![endif]-->
icon-link icon-logo-star icon-search icon-star