We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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
Obsolete No change from Document Object Model (DOM) Level 2 Core Specification
Document Object Model (DOM) Level 2 Core Specification
Comment
Obsolete No change from Document Object Model (DOM) Level 1 Specification
Document Object Model (DOM) Level 1 Specification
Comment
Obsolete Initial definition

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

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) 未实现 ? ?

相关链接

 

文档标签和贡献者

此页面的贡献者: AshfaqHossain, AlexChao
最后编辑者: AshfaqHossain,