How do you insert a comment in HTML?

How do you insert a comment in HTML?

Inserting anything in HTML requires one thing, it requires an HTML tag. Similarly, for inserting a comment in HTML, one would use the comment tag, <!-- … -->

For example:

<!-- Write HTML comments here -->

However, it should be noted that using the comment tag inserts a comment in the source code. This comment will not be displayed in the browser and can only be seen in the HTML code. The benefit of inserting comments in the HTML code is that they can be used for guidance or to put certain information, such as changes made or changes that need to be made. They can be used as communication devices to leave notes for another person working on the code, or for the future self.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.