HTML Comment Syntax

<html xmlns="http://www.w3.org/1999/xhtml">
   <!-- ... comment ... -->
   <head>
      ...
      <title>My Title</title> <!-- no comments inside title element -->
      ...
      <!-- ... comment ... -->
      ...
   </head>
   <body>
      ...
      <!-- ... comment ... -->
      ...
   </body>
   <!-- ... comment ... -->
</html>
How to code comments in HTML or XML
Rules for commenting out HTML code
Child elements in HTML comments

Although the code within HTML comments can include other tags, all of the tags between the beginning of the comments and the end of the comments will be ignored. Tags inside comments do not need to be matched up since they are not treated as nested elements.

HTML comments within scripts

However, HTML comments within scripts will not cause the script code to be ignored. This HTML code pattern was designed to allow hiding content inside a script element from any browsers that might otherwise treat that content as phrasing content rather than as JavaScript code.

Comments in JavaScript

In JavaScript code, use two slash characters (//) to comment out code to the end of the line. For a comment that can span more than one line of HTML code, start the comment with the delimiter characters /* and end it with the delimiters */.