How to Write Comments In HTML?

  • You can use the comment tag to hide scripts from browsers that don't support them,so they don't display as plain text.
  • Write an html comment like this :

    <!-- Write Comments here -->

  • Comments are not displayed by the browser, but they can help document your HTML source code.

Comments

  • With comments you can place notifications and reminders in your HTML code:
  • Comments can be used to hide content.
  • This can be helpful if you hide content temporarily:
  • You can also hide more than one line. Everything between the <!-- and the --> will be hidden from the display.

Syntax:

comment1

Output:

comment2