I wanted to use the HTML 5 template tag, but there was some confusing behavior after refreshing the page. Maybe first I will show you the code:
<!doctype html> <meta charset=utf-8> <title>HTML 5 - template test</title> <template> <h1>This is an awesome new HTML 5 template</h1> <p>.. some even more awesome content .. some even more awesome content .. some even more awesome content .. some even more awesome content .. some even more awesome content</p> </template> <div></div> <script> var template = document.querySelector('template'), templateContent = template.content.cloneNode(true); console.log(template); console.log(templateContent); document.querySelector('div').appendChild(templateContent); </script>
Actually, this works as expected, but some confusing things happen in the console. When I open the first page, she says:

but when I refresh the page, it shows the following:

When I repeat this, I see the material from the first picture again. I tried this also on jsbin, and there I do not see this behavior: http://jsbin.com/ofotah/1
I really donβt know what is going on there. I am using Google Chrome version 27.0.1453.110 (Windows). I hope you help me with this.
source share