Comment 接口代表标签(markup)之间的文本符号(textual notations)。尽管它通常不显示出来,但是在查看源码里面可以看到。在 HTML 和 XML 里,注释(Comments)为 '<!--' 和 '-->' 之间的内容。在 XML 里,字符序列 '--' 不能用于一个注释中。
属性
该接口没有特定的属性,但是从其父类(its parent)、CharacterData 继承,以及间接从 Node 继承。
构造函数
-
Comment() -
文本内容作为参数,返回一个
Comment对象。
方法
该接口没有特定的方法,但是从其父类(its parent)、CharacterData 继承,以及间接从 Node 继承。
规范
| Specification | Status | Comment |
|---|---|---|
| DOM Comment |
Living Standard | Added the constructor. |
| Document Object Model (DOM) Level 3 Core Specification Comment |
Recommendation | No change from Document Object Model (DOM) Level 2 Core Specification |
| Document Object Model (DOM) Level 2 Core Specification Comment |
Recommendation | No change from Document Object Model (DOM) Level 1 Specification |
| Document Object Model (DOM) Level 1 Specification Comment |
Recommendation | Initial definition |
浏览器兼容性
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes) |
Comment() constructor |
? | 24.0 (24.0) | 未实现 | ? | ? |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |
Comment() constructor |
? | 24.0 (24.0) | 未实现 | ? | ? |
相关链接