HTMLTemplateElement

可以使用HTMLTemplateElement 接口来访问 HTML <template>元素的内容。

属性

这个接口继承了  HTMLElement的属性

HTMLTemplateElement.content只读
DocumentFragment: 包含了 <template> 元素的模板内容。

Methods

这个接口继承了 HTMLElement的方法。

标准

标准 状态 备注
HTML Living Standard
HTMLTemplateElement interface
Living Standard  
HTML5
HTMLTemplateElement interface
Recommendation Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
HTMLTemplateElementChrome Full support 26Edge Full support 13Firefox Full support 22IE No support NoOpera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 26Firefox Android Full support 22Opera Android Full support YesSafari iOS Full support 8Samsung Internet Android Full support Yes
contentChrome Full support 26Edge Full support 13Firefox Full support 22IE No support NoOpera Full support 15Safari Full support 8WebView Android Full support YesChrome Android Full support 26Firefox Android Full support 22Opera Android Full support YesSafari iOS Full support 8Samsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support