HTML5 template not working on Internet Explorer, how to solve it?

knotty picture knotty · Mar 6, 2014 · Viewed 18.3k times · Source

I made a template in HTML5 which is working with Chrome and Firefox but not working with Internet Explorer (tested on IE 8).

How can I solve this problem?

Answer

Supersharp picture Supersharp · Apr 21, 2015

I recommend you Neovov's polyfill: https://github.com/neovov/template-element-polyfill

NB: There's a bug in IE 11: it moves <template> under the <body> element before rendering the DOM! So the parentNode attribute is wrong, and nesting will fail. You can see it in the [F12] Tool.