Template element
A built-in element serves as a storage for HTML markup templates. The browser ignores its contents, only checks for syntax validity, but we can access and use it in JavaScript, to create other elements.
In theory, we could create any invisible element somewhere in HTML for HTML markup storage purposes. What’s special about ?
First, its content can be any valid HTML, even if it normally requires a proper enclosing tag.
For example, we can put there a table row :
Usually, if we try to put inside, say, a around. That’s not what we want. On the other hand, keeps exactly what we place there.
We can put styles and scripts into as well:
The browser considers content “out of the document”: styles are not applied, scripts are not executed,