HTML5shiv is used to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9. If you are not using this HTML5shiv, then HTML5 tags won’t work on browsers which are less than Internet Explorer 9. This HTML5shiv some people call this with name of “HTML5shim”, but there is no difference between these two names and as noted in the code repository, the only difference is that “one has an m and one has a v – that’s it.
Then add this code in your head section of html document.
<!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <![endif]-->
We are using this above code because prior to internet explorer 9.0 there is not support for HTML5. So for supporting HTML5 in older version of Internet explorer we are using this code snippet and HTML5shiv or HTML5shim, where both are same.
Only apply this HTML5shiv in HTML5 documents that means which have HTML5 doctype declaration, If you want to know more about HTML5 doctype declaration and other doctype declaration.
This is the complete code of HTML5 document after adding HTML5shiv code
<!doctype html> <html> <head> <meta charset="utf-8"> <title>HTML5 Document with html5shiv</title> <!--[if lt IE 9]> <script src="js/html5shiv.js"></script> <![endif]--> </head> <body> Content goes here... </body> </html>
html5 shiv and document