W3 3.2y
4.0y
NS 3.0y
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y

<!-->

Description

Used to insert comments in the HTML source which will be ignored by the browser. All HTML elements inside the comment will be ignored. You can use this code to put comments in your pages, which can help you when you have to edit the source later.
HTML generating programs sometimes store program-specific information inside comments, so they will not be visible, but still available to the program.

This code is not a container, but inside it you can put one or more comments, by surrounding with "--". The end of the code is indicated with the sequence -->.

If the text you want to comment doesn't contain HTML elements you can use the COMMENT element.

A common use of this code is to comment the text inside the SCRIPT and STYLE elements to hide it from older browsers that do not support a scripting language.

Attributes

** None **

Examples

Source
The next lines contains 2 comments, which will not be
shown if your browser supports html comments :<BR>
<!-- This is a comment and will be ignored --
-- You can put anything in a comment, including elements: <HR> -->
 
Result
The next lines contains 2 comments, which will not be shown if your browser supports html comments :
 
Source
<SCRIPT language="JavaScript">
<!-- Begin hiding contents from older browsers
function ShowMessage(Msg) {
alert(Msg)
}
// End hiding the contents -->
</SCRIPT>
<FORM>
<INPUT type="button" value="Push me!" onClick="ShowMessage('Hi there')">
</FORM>
 
Result
 
Source
<STYLE type="text/css">
<!-- Hide style sheets from browsers that don't support this element.
H1 {color: red;}
}
End hiding the STYLE element -->
</STYLE>
 
Result
Statistics