HTML 5 may be the latest and greatest technology, but some older browsers of IE does not support most of HTML 5 tag. So found a way by which we can solve tag problem. It will be helpful if one wants to stick with HTML 5 tags.
Most HTML 5 tags like header, footer etc are not supported by IE(7, 8) browser . I have a way which we can put in html file.
Example – 1
for example, if we want to use header tag, we can do the following.
// for IE 7,8 <script>document.createElement("header");</script> <!-- for other than IE 7,8 --> <header> <div class="container"> <script type="text/javascript">document.createElement('nav');</script> <nav class="span9"> <ul class="primary-navigation"> <li class="active"> <a href="#">Nav 1</a> </li> <li> <a href="#">Nav 2</a> </li> </ul> </nav> </div> </header> Older version of IE will create/read header tag with the help of "<script>document.createElement("header");</script>".
Example – 2
<!DOCTYPE html> <html> <head> <title>Header test</title> <style> time { font-style: italic; } </style> <!-- Add this line --> <script>document.createElement('time');</script> </head> <body> <time datetime="2009-09-13">my birthday</time> </body> </html>