Comment Object
The data property sets or returns the text of a comment.
The following code fragment loads "books_comment.xml" into xmlDoc using loadXMLDoc() and outputs comment text from the first <book> element:
The output of the code above will be:
In the example above we use a loop and an if-test to make sure we only process comment nodes. A comment node has a node type of 8.
Comment Object
Your message has been sent to W3Schools.