Skip to content
The HTML Herbarium

/static/herbario/disruptivo/en/especime/template/

Menu

HTM-030 · Scripting

<template>

Markup kept aside, inert, waiting to be copied.

The content of a <template> is not rendered, downloads no images, runs no script and does not turn up in find-in-page. It sits in a separate fragment, reachable through the content property.

With shadowrootmode it gained a second life: the browser's own parser turns the template into a shadow root while reading the HTML, with no script involved at all.

<template id="linha-do-fichario">
  <li class="ficha">
    <span class="ficha__num"></span>
    <span class="ficha__nome"></span>
  </li>
</template>
{esc(legenda)}