Properties and methods of comment objects

A JavaScript object represents each HTML comment. The following table details the properties and methods of comment objects that are taken from DOM Level 1 and are used in Adobe Dreamweaver. A bullet () marks read-only properties.

Property or method

Return value

nodeType 

Node.COMMENT_NODE

parentNode 

The parent tag

childNodes 

An empty NodeList array

data

The text string between the comment markers

(<!-- and -->)

hasChildNodes()
false