You are on page 1of 1

23/10/2021 16:37 DOM - Comment Object

DOM - Comment Object

In this chapter, we will study about the Comment object. Comments are added as a notes or the
lines for understanding the purpose of an XML code. Comments can be used to include related
links, information and terms. These may appear anywhere in the XML code.
The comment interface inherits the CharacterData interface representing the content of the
comment.

Syntax
XML comment has the following syntax −

<!-------Your comment----->

A comment starts with <!-- and ends with -->. You can add textual notes as comments between
the characters. You must not nest one comment inside the other.

There are no methods and attributes defined for the Comment object. It inherits those of its
parent, CharacterData, and indirectly those of Node.

https://www.tutorialspoint.com/dom/dom_comment_object.htm 1/1

You might also like