comment, Comment | NN 6 IE 4 DOM 1
The comment object reflects the ! 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 nodeType value of 8, which identifies it as a Comment node. A Comment node has the following inheritance chain in the DOM abstract model: Node->CharacterData->Comment. While a Comment node has special values automatically assigned to some of its properties (such as nodeValue), a Comment node has no properties or methods beyond the ones inherited from the Node and CharacterData objects. Node properties and methods are discussed earlier in this chapter among the shared items; CharacterData properties and methods are covered in detail with the Text object, which also inherits from CharacterData, and is more likely to be scripted.
To reference a comment element, use relative element or node properties. While IE provides an id property by virtue of its inheritance model, you cannot assign an identifier to the element via an id attribute. Such an element in IE does, however, have a tag name value of !. Therefore, you can reference an IE HTML comment element via the collection of elements returned by the document.all.tags("!") method.
HTML Equivalent
    <!--comment text-->
Object Model Reference
    nodeReference
Object-Specific Properties
data | length | text
Object-Specific Methods
appendData( ) | deleteData( ) | insertData( ) | replaceData( )
substringData( ) |  |  |
Object-Specific Event Handler Properties
None.

data | NN 6 IE 6 DOM 1
| Read/Write
Provides the text content of the comment. See Text.data.

length | NN 6 IE 6 DOM 1
| Read-only
Provides the character count of the comment data. See Text.length.

text | NN n/a IE 4 DOM 1
| Read/Write
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 innerHTML and outerHTML 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.
Example
    document.all.tags("!")[4].text = "Replaced comment, but no one will know.";
Value
String.
Default
None.

appendData( ), deleteData( ), insertData( ), replaceData( ), substringData( ) | NN 6 IE 6 DOM 1
Provide methods for manipulating comment text. See these methods in the Text object.