XML DOM - Comment Object
Try it - Example
The following example uses the XML file books.xml.
External JavaScript to load the XML file.
createComment() - Creates a comment node
Comment Object
The Comment object represents the content of a comment node in a document.
Comment Object Properties
| property | Description |
|---|---|
| data | Sets or returns the text of this node. |
| length | Returns the length of the text of this node. |
Comment Object Methods
| Method | Description |
|---|---|
| appendData() | Appends data to the node. |
| deleteData() | Deletes data from the node. |
| insertData() | Inserts data into the node. |
| replaceData() | Replaces data in the node. |
| substringData() | Extracts data from the node. |