Loading...
HTML <template> Tag

HTML <template> Tag

In this tutorial, we will learn about template tag in HTML with the help of examples.


<template> Tag

Template tag <template> is used as a container to hold some HTML content hidden from the user and can be rendered later with a Javascript.

Syntax

<template>..........</template>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>template tag</title>
  </head>
  <body>
    <p>This is the best website for learning code.<template>Our website</template></p>
  </body>
</html>

Output

This is the best website for learning code.


Global Attribute

Template Tag support all the global attributes of HTML.


Event Attribute

Template Tag support all the event attributes of HTML.


Next Tutorial

We hope that this tutorial helped you develop better understanding of the concept of <template> tag in HTML.

Keep Learning : )

In the next tutorial, you'll learn about HTML <textarea> Tag.

- Related Topics