Like in all programming languages it is a good practic to use comments for your code as it helps you to describe the source code of the HTML document
However you need to know that:
Comments do not affect the content of the HTML page. So this is not visible to the user
We use comments for two different reasons
To explain the source code of the HTML document and for debugging and testing purposes
We use <!--This is an example comment --> to add comments to the source code
We will see a very simple example
This is the source code of the example
Then for most codes and examples we will run it
RunAs you can see there is no change however this makes the software developer to read the code more better
Rather than deleting the part of the HTMl content we could use thec comment tag to temporarily make the HTML code inactive for debugging purposes and to check where the error has occured.Let us see an example
Then for most codes and examples we will run it
RunThis shows the Heading tags are not run as it is within comment tags