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.
This interface has no specific property, but inherits those of its parent, CharacterData, and indirectly those of Node.
Comment()
Comment object with the parameter as its textual content.This interface has no specific method, but inherits those of its parent, CharacterData, and indirectly those of Node.
| Specification | Status | Comment |
|---|---|---|
| DOM The definition of 'Comment' in that specification. | Living Standard | Added the constructor. |
| Document Object Model (DOM) Level 3 Core Specification The definition of 'Comment' in that specification. | Obsolete | No change from Document Object Model (DOM) Level 2 Core Specification |
| Document Object Model (DOM) Level 2 Core Specification The definition of 'Comment' in that specification. | Obsolete | No change from Document Object Model (DOM) Level 1 Specification |
| Document Object Model (DOM) Level 1 Specification The definition of 'Comment' in that specification. | Obsolete | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 1 | Yes | 1 | Yes | Yes | Yes |
Comment() constructor
|
Yes | Yes | 24 | No | Yes | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | Yes | Yes | Yes | Yes | ? |
Comment() constructor
|
? | Yes | Yes | 24 | Yes | ? | ? |
© 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