<template> tag

HTML5 <template> tag

The <template> tag  in HTML5 can hide the content from the user in the document.

By default, the HTML document will not render the content of this tag when the page loads.

To override this behavior,  you can use JavaScript so that the content inside this tag will be rendered.

Syntax:
<template>text…</template>

Example

<template>
  <p>Learn HTML from TutorialBrain.com and Explore more.</p>
</template>

Default CSS Value

NONE

How Browser will display

NONE

Difference between HTML4.01, XHTML and HTML5

HTML4 XHTML HTML5
NA NA New tag in HTML5

Attributes used with <template> tag

NONE

Global Attributes

The <template> tag supports Global attributes.

Event Attributes

The <template> tag supports Event attributes.

Supporting Browsers

template tag supporting browser

Tutorials for all brains!