HTMLTemplateElement

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since November 2015.

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

EventTarget Node Element HTMLElement HTMLTemplateElement

Instance properties

This interface inherits the properties of HTMLElement.

content Read only

A read-only DocumentFragment which contains the DOM subtree representing the <template> element's template contents.

Instance methods

This interface inherits the methods of HTMLElement.

Specifications

Specification
HTML Standard
# htmltemplateelement

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
HTMLTemplateElement
content
shadowRootClonable
shadowRootDelegatesFocus
shadowRootMode
shadowRootSerializable
Experimental