HTML Template Tag
In HTML, the
<template> tag is used for holding the client-side content on the web page.
One thing to note is that content inside the
<template>tag will not be rendered at the time of Page Loading.
While the parser does process the contents of the
<template>tag while loading the page, it does so only to ensure that those contents are valid.
A template is just like a content fragment that is being stored for subsequent use in the document.
<template> Tag Syntax and Usage
<template> tag requires the start(opening) tag and end(closing) tag.
Following is the syntax for using the template tag in your HTML code:
<template> ..content here </template>
HTML <template> Tag Basic Example
Below we have a basic example showing how we use the HTML template tag.
<template> Tag Attributes
This tag does not have specific attributes; though it supports global and event attributes.
Browser Support for HTML
Following browsers support this attribute:
Google Chrome 6.0+