HTMLTemplateElement
可以使用HTMLTemplateElement
接口来访问 HTML <template>
元素的内容。
属性
这个接口继承了 HTMLElement
的属性
HTMLTemplateElement.content
只读DocumentFragment
对象,包裹了模板元素<template>
的内容。这个属性是只读的DOM树。
Methods
这个接口继承了 HTMLElement
的方法。
标准
标准 | 状态 | 备注 |
---|---|---|
HTML Living Standard HTMLTemplateElement interface |
Living Standard | |
HTML5 HTMLTemplateElement interface |
Recommendation | Initial definition |
浏览器兼容性
BCD tables only load in the browser