: The TEMPLATE Element
Last updated: 2026-09-12
<template>The TEMPLATE Element
Declares a reusable HTML fragment that is not rendered and whose scripts do not run, until JavaScript clones and inserts it.
| Category | Scripts & Embedding |
|---|---|
| Content Model | Flow content |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Yes — requires closing </template> tag |
| Status | Standard |
📝 Syntax
<template id="row">
<tr><td></td></tr>
</template>
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <template> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: template content exists in the DOM but is invisible and inert; access via .content then cloneNode.
🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.