Elements – Comment Tag

Comment Tag

Comments are tags used to leave notes in the document. Only the developer have access to the comments, the final user don’t see unless they check with the browser’s Inspector Element.

When you’re working in some code, it’s helpful to leave tips to others developers in order to understand what the work is about.


<!-- This is a comment -->

Comments can also be used to make code inactive without having to delete it entirely.


<!-- <h1>Hello Campers</h1> --> <h2>Hello Friends</h2> <!-- <p>Hello Paragraph</p> -->

The example would display “Hello Friends”, but “Hello Campers” and “Hello Paragraph” would not be displayed as they are comments, and are only visible in code or Inspect Element.

This article needs improvement. You can help improve this article. You can also write similar articles and help the community.