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

HTMLTemplateElement.content

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

Syntax

var documentFragment = templateElement.content

Example

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

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'HTMLTemplateElement interface' in that specification.
Living Standard  
HTML5
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,