Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML
Website builder

HTML Comments Tag

The information on this page is based on HTML version 4.01 (which is the current version of HTML). The next version, HTML 5, is currently being written. Here's a list of HTML 5 tags.

The HTML 'comments' tag is used for creating comments within your HTML code.

Comments aren't displayed in the browser - they are simply there for the programmer's benefit. Comments can assist you, the HTML programmer, because you can write notes to yourself that explain what the code does. This is especially useful when you have a lot of code.

HTML comments are often used in conjunction with JavaScript. Programmers surround their JavaScript code with HTML comments. The HTML comments tell browsers that don't support JavaScript (or with JavaScript disabled) to ignore the code in between. This prevents the code from being displayed to your users.

You can see an example here.

Example <!-- Here is a comment. The browser will not display this text. -->
Attributes: None.
Try it yourself!


Also see the HTML 5 version of HTML tags

Enjoy this page?

  1. Add this page to your Favorites
  2. Link to this page (copy/paste into your own website or blog):
  3. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!