Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML The comment tag

HTML The comment tag

Example

HTML comment:

<

p

This is a paragraph

p

Try it »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support comment tag.


Tag Definition and Usage Notes

The comment tag is used to insert comments into the source document. Comments are not displayed in the browser.

You can use comments to explain your code, which helps you edit the code later. This is especially useful when the amount of code is large.

You can also store program-specific information in the comment content. In this case, the information is invisible to the user but available to the program. A good practice is to put comments or style elements inside comment text, so that older browsers that do not support scripts or styles will not display them as plain text.

<script type="text/javascript">

For more information about HTML standard attributes, please visit Standard Attributes.


Event attribute

The comment tag does not support any event attributes.

For more information about HTML event attributes, please visit Event attribute.