Share on Google+Share on Google+

HTML5 comment tag Example, Definition of comment tag.

In this tutorial, we will learn about comment tag.

HTML5 comment tag Example,, Definition of <!--  --> comment tag.

In this tutorial, we will introduce you to the <!-- --> comment tag of HTML5. This tag is used to insert the comment inside the source code. The text written inside comment tag will define what next piece of code are doing. Comment tag is always used inside the body.

Text present in the comment tag will be ignored by the browser including html tag, scripting language etc. Text written in comment tag can be visible only for developer. It can not be read by user.

Declaration Syntax :

Declaration syntax of comment tag in Html5.

                            <!-- Comment area  -->

Example of <!--  --> in HTML5:



<!Doctype HTML>
<title>Example Of comment tag.</title>
<p><b>Example of comment tag.</b></p>
<!-- Comment field. you can write any thing.--><br>
<!-- Table store information in the form of row and column. --> 
<table border="1">
<tr><th style="width: 57px">Id</th><th style="width: 108px">Name</th>
  <th style="width: 114px">Age</th></tr>
  <tr><th >1</th><th >Bharat Singh</th>
  <th >24</th></tr>
  <tr><th >2</th><th >Ankit Kumar</th>
  <th >25</th></tr>
<b>Write HTML tag and scripting language inside the comment tag. </b>
<!-- This is comment tag of HTML5.
<p>Paragrapha tag of HTML</p>
<script type="text/javascript" 
 <b>Not visible.</b>


See the browser compatible page for successfully rendering the program.

Download this code

Difference Between HTML5 and HTML4.01:

There is no difference in between HTML4.01 and HTML5 comment tag.


Posted on: August 27, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null