Scripting
<template> Template
Inert HTML that the browser parses but does not render, ready for JavaScript to clone.
<template id="row">
<li class="item"></li>
</template>
<script>
const li = row.content.cloneNode(true);
</script>Tip. With shadowrootmode it builds a shadow root right in the HTML, no JavaScript needed.
- Since
- HTML5
- Implicit role
- None
- Void
- No
Attributes4
- shadowrootmode
- shadowrootdelegatesfocus
- shadowrootclonable
- shadowrootserializable