Tag Description
The comment tag (<!--...-->
) is used to insert a comment into the source code. A comment will be ignored by the browser and therefore, not displayed.
An HTML comment begins with "<!--", ends with "-->". It can not contain "--" or ">" anywhere in the comment.
This tag has the form:
<!-- comment text -->
Note: Comments can span multiple lines, but cannot be nested within each other.
HTML5 and HTML4.01 Differences
None.
Global Attributes
None supported.
Event Attributes
None supported.
Examples
The following example shows the basic use of this tag:
<!--This is a comment-->
<!--This is
another comment-->
<!--
This is
another
comment
-->
<h2>Heading Text</h2>
<p>Paragraph Text</p>
This produces the following result:
Heading Text
Paragraph Text