0% found this document useful (0 votes)
47 views

HTML Comment Tag

This document provides information about the HTML <!- - > comment tag. It defines the comment tag as used to insert comments in HTML source code that are not displayed in browsers. The tag can be used to explain code for future reference or hide scripts from browsers without script support. Browser support for the tag is universal across major browsers. Tips are provided such as using // to prevent JavaScript from executing the -> tag when commenting out JavaScript code.

Uploaded by

whoamiwaddup2345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

HTML Comment Tag

This document provides information about the HTML <!- - > comment tag. It defines the comment tag as used to insert comments in HTML source code that are not displayed in browsers. The tag can be used to explain code for future reference or hide scripts from browsers without script support. Browser support for the tag is universal across major browsers. Tips are provided such as using // to prevent JavaScript from executing the -> tag when commenting out JavaScript code.

Uploaded by

whoamiwaddup2345
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

8/20/2014 HTML comment tag

http://www.w3schools.com/tags/tag_comment.asp 1/3
REFERENCES | EXAMPLES | FORUM
HTMLReference
HTMLbyAlphabet
HTMLbyCategory
HTMLGlobalAttributes
HTMLEvents
HTMLCanvas
HTMLAudio/Video
HTMLDoctypes
HTMLColornames
HTMLColorpicker
HTMLColormixer
HTMLCharacterSets
HTMLURLEncode
HTMLLanguageCodes
HTMLCountryCodes
HTTPMessages
HTTPMethods
KeyboardShortcuts
HTMLTags
<!>
<!DOCTYPE>
<a>
<abbr>
<acronym>
<address>
<applet>
<area>
<article>
<aside>
<audio>
<b>
<base>
<basefont>
<bdi>
<bdo>
<big>
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center>
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir>
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font>
<footer>
<form>
<frame>
<frameset>
<head>
<header>
<h1><h6>
Previous CompleteHTMLReference Next
Previous CompleteHTMLReference Next
HTML<!...>Tag
Example
AnHTMLcomment:
<!Thisisacomment.Commentsarenotdisplayedinthebrowser>
<p>Thisisaparagraph.</p>
TryitYourself
DefinitionandUsage
Thecommenttagisusedtoinsertcommentsinthesourcecode.Commentsarenotdisplayedinthebrowsers.
Youcanusecommentstoexplainyourcode,whichcanhelpyouwhenyoueditthesourcecodeatalaterdate.Thisisespeciallyusefulif
youhavealotofcode.
BrowserSupport
Element
<!...> Yes Yes Yes Yes Yes
DifferencesBetweenHTML4.01andHTML5
NONE.
TipsandNotes
Youcanalsousethecommenttagto"hide"scriptsfrombrowserswithoutsupportforscripts(sotheydon'tshowthemasplaintext):
<scripttype="text/javascript">
<!
functiondisplayMsg()
{
alert("HelloWorld!")
}
//>
</script>
Note:Thetwoforwardslashesattheendofcommentline(//)istheJavaScriptcommentsymbol.ThispreventsJavaScriptfromexecuting
the>tag.
StandardAttributes
Thecommenttagdoesnotsupportanystandardattributes.
MoreinformationaboutStandardAttributes.
EventAttributes
Thecommenttagdoesnotsupportanyeventattributes.
MoreinformationaboutEventAttributes.
Searchw3schools.com:
WEBHOSTING
WEBBUILDING
W3SCHOOLSEXAMS
HTML,CSS,JavaScript,PHP,
jQuery,XML,andASP
Certifications
SHARETHISPAGE
WEBRESOURCES
WebStatistics
WebValidation
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
Select Language
8/20/2014 HTML comment tag
http://www.w3schools.com/tags/tag_comment.asp 2/3
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen>
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem>
<meta>
<meter>
<nav>
<noframes>
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike>
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<textarea>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt>
<u>
<ul>
<var>
<video>
<wbr>
Top10Tutorials
HTMLTutorial
HTML5Tutorial
CSSTutorial
CSS3Tutorial
JavaScriptTutorial
jQueryTutorial
SQLTutorial
Top10References
HTML/HTML5Reference
CSS1,2,3Reference
CSS3BrowserSupport
JavaScript
HTMLDOM
XMLDOM
PHPReference
Top10Examples
HTMLExamples
CSSExamples
JavaScriptExamples
HTMLDOMExamples
PHPExamples
jQueryExamples
XMLExamples
WebCertificates
HTMLCertificate
HTML5Certificate
CSSCertificate
JavaScriptCertificate
jQueryCertificate
PHPCertificate
XMLCertificate
ColorPicker
8/20/2014 HTML comment tag
http://www.w3schools.com/tags/tag_comment.asp 3/3
REPORTERROR | HOME | TOP | PRINT | FORUM | ABOUT | ADVERTISEWITHUS
PHPTutorial
ASP.NETTutorial
XMLTutorial
jQueryReference
ASP.NETReference
HTMLColors
XMLDOMExamples
ASPExamples
SVGExamples
ASPCertificate
W3Schoolsisoptimizedforlearning,testing,andtraining.Examplesmightbesimplifiedtoimprovereadingandbasicunderstanding.Tutorials,references,andexamplesareconstantlyreviewedtoavoid
errors,butwecannotwarrantfullcorrectnessofallcontent.Whileusingthissite,youagreetohavereadandacceptedourtermsofuse,cookieandprivacypolicy.Copyright19992014byRefsnesData.
AllRightsReserved.

You might also like