<html>
<link rel="stylesheet" href="josh.css">
<body bgcolor="#FFFFFF">

		<div id="Description">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">comment, Comment</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">4</span>  DOM <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>The <span class="literal">comment</span> object reflects the
<span class="literal">!</span> element in an HTML document. But in a W3C DOM
environment, such as Netscape 6, this object is not a genuine element
in the context of the W3C DOM abstract model. Instead, the object is
simply a special kind of node. Such a node has a
<span class="literal">nodeType</span> value of 8, which identifies it as a
<span class="literal">Comment</span> node. A <span class="literal">Comment</span> node
has the following inheritance chain in the DOM abstract model:
<span class="literal">Node</span>-&gt;<span class="literal">CharacterData</span>-&gt;<span class="literal">Comment</span>.
While a <span class="literal">Comment</span> node has special values
automatically assigned to some of its properties (such as
<span class="literal">nodeValue</span>), a <span class="literal">Comment</span> node has
no properties or methods beyond the ones inherited from the
<span class="literal">Node</span> and <span class="literal">CharacterData</span> objects.
<span class="literal">Node</span> properties and methods are discussed earlier
in this chapter among the shared items;
<span class="literal">CharacterData</span> properties and methods are covered
in detail with the <span class="literal">Text</span> object, which also
inherits from <span class="literal">CharacterData</span>, and is more likely to
be scripted.
</p>
							</td>
						</tr>
						<tr>
							<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
						</tr>
						<tr>
							<td colspan="2"><p>			To reference a comment element, use relative element or node
properties. While IE provides an <span class="literal">id</span> property by
virtue of its inheritance model, you cannot assign an identifier to
the element via an <span class="literal">id</span> attribute. Such an element
in IE does, however, have a tag name value of <span class="literal">!</span>.
Therefore, you can reference an IE HTML comment element via the
collection of elements returned by the
<span class="literal">document.all.tags("!")</span> method.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="htmlequivalent"><span class="title">HTML Equivalent</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>&lt;!--<span class="replaceable">comment text</span>--&gt;</pre>
						</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="objectmodelreference"><span class="title">Object Model Reference</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre><span class="replaceable">nodeReference</span></pre>
						</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="objectspecificproperties"><span class="title">Object-Specific Properties</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table border="1"><tbody><tr><td><span class="literal">data</span></td><td><span class="literal">length</span></td><td><span class="literal">text</span></td>
								</tr>
							</tbody></table>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="objectspecificmethods"><span class="title">Object-Specific Methods</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td>
						<table border="1"><tbody><tr><td><span class="literal">appendData( )</span></td><td><span class="literal">deleteData( )</span></td><td><span class="literal">insertData( )</span></td><td><span class="literal">replaceData( )</span></td>
								</tr>
								<tr><td><span class="literal">substringData( )</span></td><td></td><td></td><td></td>
								</tr>
							</tbody></table>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="objectspecificeventhandlerproperties"><span class="title">Object-Specific Event Handler Properties</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			None. </p>
					</td>
				</tr>
			</table>
		</div><div id="data">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">data</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">6</span>  DOM <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">Read/Write&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provides the text content of the comment. See
<span class="literal">Text.data</span>.
</p>
												</td>
</tr>
			</table>
		</div><div id="length">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">length</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">6</span>  DOM <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">Read-only&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provides the character count of the comment data. See
<span class="literal">Text.length</span>.
</p>
												</td>
</tr>
			</table>
		</div><div id="text">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">text</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">n/a</span> IE <span class="emphasis">4</span>  DOM <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">Read/Write&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provides the text content of the element. Due to the nature of this
element, the value of the text property is identical to the values of
the <span class="literal">innerHTML</span> and <span class="literal">outerHTML</span>
properties. Changes to this property do not affect the text of the
comment as viewed in the browser's source code
version of the document. This property is not available in IE
4/Macintosh.
</p>
												</td>
</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="example"><span class="title">Example</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td><span class="programlisting"><pre>document.all.tags("!")[4].text = "Replaced comment, but no one will know.";</pre>
						</span></td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="value"><span class="title">Value</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			String.</p>
					</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap colspan="2" class="default"><span class="title">Default</span></td>
				</tr>
				<tr>
					<td colspan="2"><p>			None. </p>
					</td>
				</tr>
			</table>
		</div><div id="appendData( ), deleteData( ), insertData( ), replaceData( ), substringData( )">
			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
				<tr><td valign="top" class="name">appendData( ), deleteData( ), insertData( ), replaceData( ), substringData( )</td><td valign="top" nowrap class="compatibility">NN <span class="emphasis">6</span> IE <span class="emphasis">6</span>  DOM <span class="emphasis">1</span>&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" nowrap class="usage"><p class="literal"></p>
					</td><td valign="top" nowrap class="requirements">&nbsp;&nbsp;</td>
				</tr>
				<tr>
					<td valign="top" colspan="2" class="description">
						<p>Provide methods for manipulating comment text. See these methods in
the <span class="literal">Text</span> object.
</p>
												</td>
</tr>
			</table>
		</div>

</body>
</html>