The <!-- ... --> tag is used to insert comments in an HTML code. Its content is ignored by the browsers and is not displayed by them. However, the comments are visible to anyone who views the page source code.
HTML comments point out document sections or insert notes explaining the code. The comment tag can also be used to exclude short-term code blocks instead of deleting them.
Comments can be used anywhere in the documents except for the <title> tag.
Comments are written between <!-- and --> symbols.
Example of the HTML comment tag:
<html> <head> <title>Example of using the comment tag.</title> </head> <body> The content of the page. <!-- This is our comment, that is not displayed on the browser. --> </body> </html>
The comment tag can be used for “hiding” scripts from browsers without any support for scripts.
The comment tag doesn’t support the Global Attributes.