The HTMLTemplateElement.content
property returns a <template>
element's template contents (a DocumentFragment
).
Syntax
var documentFragment = templateElement.content
Example
var templateElement = document.querySelector("#foo"); var documentFragment = templateElement.content.cloneNode(true);
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'HTMLTemplateElement interface' in that specification. |
Living Standard | |
HTML5 The definition of 'HTMLTemplateElement interface' in that specification. |
Recommendation | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
content | Chrome Full support 26 | Edge Full support 13 | Firefox Full support 22 | IE No support No | Opera Full support 15 | Safari Full support 8 | WebView Android Full support Yes | Chrome Android Full support 26 | Firefox Android Full support 22 | Opera Android Full support Yes | Safari iOS Full support 8 | Samsung Internet Android Full support 1.5 |
Legend
- Full support
- Full support
- No support
- No support