HTML Comment Tag
In the HTML code if you want to comment the code line the <comment> tag or <!– code !> is used.
The HTML <comment> tag allows users to comment on their HTML code. This tag is supported by IE only.
It is recommended to use <!–….–> to comment on your tags. This tag is compatible to all browsers.
Suggestion − The <comment> tag deprecated in HTML5.
Example for HTML comment Tag
<!DOCTYPE html>
<html> <head>
<title>HTML <!–HTML Tag Code–> Tag</title>
</head>
<body>
<h1>Example for comment </h1>
<!–<H1> Hello welcome to w3HTMLSchool website</h1>–>
<comment>Hello This is a commented line in IE Not in Microsoft Edge</comment>
</body>
</html>
Output
Example for comment
This is a commented line in IE Not in Microsoft Edge
Explanation of above Example. The HTML code comes inside the <!– –>Not Display on the browser .Whereas Example for <!– comment –> is displayed .
Browser Support for tag
Chrome | Firefox | IE/Edge | Opera | Safari | Android |
Yes | Yes | Yes | Yes | Yes | Yes |