The HTMLTemplateElement interface enables access to the contents of an HTML <template> element.


This interface inherits the properties of HTMLElement.

HTMLTemplateElement.contentRead only
DocumentFragment: Returns the <template> element's template contents.


This interface inherits the methods of HTMLElement.


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
content261322 No158
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support2626 Yes22 ?8 ?
content2626 Yes22 ?8 ?

Document Tags and Contributors

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