Thursday, August 21, 2014
Sign-In  |  Sign-Up  |  Contact Us  | Bookmark |  RSS Feed

HTML5 Tutorial FeedBurner

The HTML5 <!--…--> Comment Tag  
The HTML5 <!--…--> tag is mainly utilized for adding comment in the source code. However, do not expect the comment to appear on the web browser. Utilizing the HTML5 <!--…--> tag is important for adding comments which will serve as notes regarding your code. That way, if alterations have to be done in the future, it is useful as a reference. When there are multiple source codes, this tag will avoid confusion.

Another way to use the HTML5 <!--…--> tag is to be able to hide the scripts in browsers that do recognize it. It is a tag that would avoid showing the script as a plain text.

When used for scripts, it is necessary to add // at the end of the comment. The // is a comment symbol in JavaScript. It would look like this:

<script type="text/javascript">


function displayMsg()


alert("Comment should be placed here!")




Adding the // is necessary so that JavaScript would not interpret it as the --> tag.

The HTML5 <!--…--> tag is compatible with the different main browsers that are being utilized these days like Internet Explore, Firefox, Opera, Safari and Google Chrome.

Using the <!--…--> tag is the same for both HTML5 and HTML4.01. This tag does not support the Global Attributes and Event Attributes.

Print HTML5 <!--…--> Comment Tag Bookmark HTML5 <!--…--> Comment Tag

Related Articles  
The HTML5 <tbody> Tag
Grouping the body content for tables that are included within the HTML document is necessary. Hence the use of HTML5 ...
The HTML5 <abbr> Tag
The main purpose of the HTML5 <abbr> Tag is to indicate that the text is an abbreviation or an acronym.
The HTML5 <audio> Tag
The HTML5 <audio> tag is useful when it comes to providing sound like audio file or music streaming. Playing ...
The HTML5 <optgroup> Tag
The HTML5 <optgroup> tag is important when putting a drop down list within the HTML document. The main purpose of ...
The HTML5 <br> tag
The HTML5 <br> tag is an element which inserts a single line break. The HTML5 <br> tag is important because ...
The HTML5 <div> Tag
The HTML5 <div> tag is the key in separating different partitions within an HTML document. It is capable of ...