MDN will be in maintenance mode on Friday September 22nd, starting at 10 AM Pacific / 5 PM UTC, for about 1 hour.


The HTMLTemplateElement.content property returns a <template> element's template contents (a DocumentFragment).


var documentFragment = templateElement.content


var templateElement = document.querySelector("#foo");
var documentFragment = templateElement.content.cloneNode(true);


Specification Status Comment
HTML Living Standard
The definition of 'HTMLTemplateElement interface' in that specification.
Living Standard  
The definition of 'HTMLTemplateElement interface' in that specification.
Recommendation Initial definition

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 26 13 22 (22) No support 15 7.1
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? (Yes) ? No support ? iOS 8

See also

Document Tags and Contributors

 Contributors to this page: walterebert, sideshowbarker
 Last updated by: walterebert,