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.


HTML Standard
# htmltemplateelement

Browser compatibility

BCD tables only load in the browser