Comment in HTML - HTML Tutorial

  • The comment tag is used to insert the comments in source code. The browsers are not displaying the comments.
  • To explain the code we can use comments tag.
  • If we have a lot of coding lines the comment tag is used.

Syntax for comments in HTML


Sample coding for comment tag:

<!DOCTYPE html>
  <html >
       <!--This is the comment tag--> 
       <h1>This is a heading tags to display a header</h1> 
       <!--Comments are not displayed in the browser-->

Code Explanation for comment tag:

code-explanation for comments

  1. The comment is highlighted and it is hidden. The comment tag is not displayed in the Browser.
Yes Yes Yes Yes Yes

Tips and notes:

  • If you hide the scripts from browsers without support for scripts using the comment tag.
  • The comment tag is used for large code program.
  • Now the JavaScript is also executing the -->tag. In previous, using two forward slashes (//) at the end of the comment line.

Related Searches to Comment in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.