HTML5 comment tag Example, Definition of comment tag.
In this tutorial, we will learn about 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.
Example of <!-- --> in HTML5:
Code:Comment.html
<!Doctype HTML>
<html>
<head>
<title>Example Of comment tag.</title>
</head>
<body>
<p><b>Example of comment tag.</b></p>
<!-- Comment field. you can write any thing.--><br>
<!-- Table store information in the form of 3 row and 3 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>
</table>
<br>
<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" >
document.write("HTML5");
</script>
--><br>
<br>
<b>Not visible.</b>
</body>
</html>
|
Output:
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.