How to create hidden comments in HTML?

HTMLWeb DevelopmentFront End Technology

To create hidden comments in HTML, add <!--- tag and end it with -- >. Whatever comes inside it is hidden. These comments are beneficial for those who need to refer the code again, which allow them to easily understand the code.

Comments can be considered as a note to yourself, which also hides HTML code, so the browser doesn't display it.

Example

You can try to run the following code to learn about hidden comments in HTML

Live Demo

<!DOCTYPE html>
<html>
<head>
<title>HTML Comments</title>
</head>
<body>
   <!-- This is a comment. -->
   <p>
      <!-- This is a comment. -->
      This is demo text.
   </p>
</body>
</html>
raja
Updated on 15-Jun-2020 08:21:01

Advertisements