asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Elements > HTML Comment Element

comment Tags


Prevents any enclosed content from being displayed.HTML 2, 3.2, 4, 4.01, 5

HTML Syntax

Remarks

Comment tags in HTML are used to add explanatory notes to a document, which do not display in a browser but can provide useful information for human readers of the code.

They are used for documentation, to describe the purpose, functionality, or logic of a block of code, for noting historical changes in the code, and for temporarily disabling or hiding sections of HTML markup without necessarily removing them, among others.

Comments start with the string <!-- and end with the string -->. Any content within are ignored and are not visible on the rendered page.

Comments can enhance the readability and maintainability of code, particularly for documents that are worked on by a team of developers.

Attributes

The <comment> element has no attribute of its own, but supports global attributes common to all HTML elements.

Example

The following example shows how <comment> tags may be used.

<!-- This text will not appear. -->
See Also



Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note