The JavaScript workaround to enable HTML5 elements in versions of Internet Explorer that do not support it. That is widely known as HTML Shiv. There is also a version called HTML Shim which does the same thing.

Code Snippet

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

Sample Usage

<!DOCTYPE HTML>
<html>
<head>
     <!--[if lt IE 9]>
          <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
     <![endif]-->
     <style>
          article {
               font-size: 20px;
               color: #333;
          }
     </style>
</head>
<body>
     <article>Sample Text</article>
</body>
</html>

Note

If you want to host the script file in your own server, get the script file here




author's photo

Author : Susan Haynes

I have been in software industry for more than 10 years. I have developed different type of software using different languages. I have knowledge in languages such as Ruby, Python, PHP, Flash, .NET, Java, and jQuery. Currently I am working as a Tech Lead in Singapore.

COMMENTS
blog comments powered by Disqus