Javatpoint Logo
Javatpoint Logo

HTML <template> tag

HTML <template> tag is used to hold the client-side content that will not render at the time of page load, but it can be instantiated during runtime using JavaScript.

The content of the template will not be displayed until it is not activated using JavaScript. The browser processes the content of the <template> element while loading the page to ensure that the content is valid, the contents are not rendered, however.

It can also be useful when you want to use same content multiple times in your HTML document without any change.

The <template> tag can be placed anywhere inside of <head>, <body>, <frameset>, or <table> elements.

The <template> tag is newly added element in HTML5.

Syntax

Following are some specifications about the HTML <template> tag

Display None
Start tag/End tag Start and End tag
Usage Formatting

Example

Test it Now

Output:

HTML template tag

Attribute:

Tag-specific attributes:

The <template> tag does not contain any specific attribute.

Global attribute:

The <template> tag supports the Global attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<template>YesNoYesYesYes
Next TopicHTML textarea Tag




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA