Code Snippet

Home » Code Snippets » JavaScript » Make HTML5 Elements Work in Old IE

Make HTML5 Elements Work in Old IE

(function(){if(!/*@cc_on!@*/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="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Reference URL

Subscribe to The Thread

  1. Cool. :) Thanks

  2. Is this script works for ie6?

  3. This works great. thanks

  4. Hi,

    I am getting error while I am trying – createLinearGradient.. Can you please help on this.

    Varsh..

  5. How is it that IE hasn’t disappeared yet? When will Microsoft realize that its browser cannot catch up. Put it out of its misery – it’s aging horribly and dying . . .

    • You mean like this?
      http://www.ie6countdown.com/

      Microsoft knows full and well that IE6 is way outdated. Users / Businesses either don’t know enough, don’t care enough, or invested too much time and money to upgrade regularly or at all.

  6. this should probably be updated to look something like this:

    &lt!--[if lt IE 9]&gt
     &ltscript src="http://html5shiv.googlecode.com/svn/trunk/html5.js"&gt&lt/script&gt
      &lt![endif]--&gt

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~