W3cubDocs

/DOM

Comment

The Comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. Comments are represented in HTML and XML as content between '<!--' and '-->'. In XML, the character sequence '--' cannot be used within a comment.

Properties

This interface has no specific property, but inherits those of its parent, CharacterData, and indirectly those of Node.

Constructor

Comment()
Returns a Comment object with the parameter as its textual content.

Methods

This interface has no specific method, but inherits those of its parent, CharacterData, and indirectly those of Node.

Specifications

Browser compatibility

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
Comment() constructor ? (Yes) 24.0 (24.0) No support ? ?
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
Comment() constructor ? (Yes) 24.0 (24.0) No support ? ?

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Comment