We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support261322 No158
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support2626 Yes22 ?8 Yes

See also

Document Tags and Contributors

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