Skip to content
  • About
  • Computer Languages
  • Design & Illustration
  • Donate
  • Downloads
  • My Documents
  • Office
  • References
  • School Management System
  • Technology Basics
  • Utilities
  • Welcome to the official site of DW Faisalabad
Search for:
DW Faisalabad

DW Faisalabad

Skip to content
  • Languages
    • CSS
    • HTML
    • JavaScript
  • Office
    • Adobe Acrobat
    • Microsoft Office 2016
    • SPSS
    • Shortcut Keys
  • Design & Illustration
    • Adobe Illustrator
    • Adobe Photoshop
    • CorelDRAW
  • Technology
    • Computer
    • Microsoft Windows
    • Online Safety
  • School Management System
  • Utilities
  • Blog
  • YouTube
02 OCT

HTML <template> Tag

Example

The template element holds HTML code without displaying it:

<template>
<h2>Flower</h2>
<img src=”img_white_flower.jpg”>
</template>

Try it Yourself »


Definition and Usage

The <template> tag holds its content hidden from the client.

Content inside a <template> tag will not be rendered.

The content can be visible and rendered later by using JavaScript.

Use the <template> tag when you have HTML code you want to use over and over again, but not until you ask for it. To do this without the <template> tag, you have to create the HTML code with JavaScript to prevent the browser from rendering the code.


Browser Support

Element
<template> 26.0 13.0 22.0 9 15.0

Differences Between HTML 4.01 and HTML5

The <template> tag is new in HTML5.


Global Attributes

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

Categories: HTML Tags / by Zahid Farid 2 October 2018

Post Author: Zahid Farid

Related Posts '

07 OCT

HTML <acronym> Tag

Not Supported in HTML5 Example An acronym is marked up as follows: Can I get this <acronym title="as soon as...

HTML Tags Read More
07 OCT

HTML <section> Tag

Example A section in a document, explaining what WWF is: <section> <h1>WWF</h1> <p>The World Wide Fund for...

HTML Tags Read More
07 OCT

HTML <select> Attributes

HTML <select> autofocus Attribute A drop-down list with...

HTML Tags Read More
07 OCT

HTML <small> Tag

Example Define a smaller text: <p>DW Faisalabad</p> <p><small> - the world's largest web development...

HTML Tags Read More
07 OCT

HTML <source> Attributes

HTML <source> src Attribute An audio player with two source files. The browser should choose which file (if any) it has...

HTML Tags Read More
Search for:

Related Posts

  • HTML <acronym> Tag
  • HTML <section> Tag
  • HTML <select> Attributes
  • HTML <small> Tag
  • HTML <source> Attributes
Go to mobile version