Document.createelement can create new tags for HTML5, but it is better to use innerHTML for dynamic creation, especially for elements. However, the innerhtml of IE has a lot of problems, Style,link, script needs special method to generate. This method will also be used for the creation of new elements of our HTML5! See the following example:
<!doctype html>
<title> dynamically create HTML5 elements by Masaki </title>
<script>
var div = document.createelement ("div");
div.innerhtml = "<section>section</section>";
alert (div.innerhtml); "Section</section>" in IE6~IE8
</script>
<body>
Dynamically creating HTML5 elements by Masaki
</body>
Code two
<!doctype html>
<title> dynamically create HTML5 elements by Masaki </title>
<script>
var div = document.createelement ("div");
div.innerhtml = "fixie<div>" + "<section>section</section>" + "</div>";
alert (div.innerhtml);
alert (div.lastchild.innerhtml);
</script>
<body>
Dynamically creating HTML5 elements by Masaki
</body>