From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/comment/index.html | 72 ++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 files/zh-cn/web/api/comment/index.html (limited to 'files/zh-cn/web/api/comment/index.html') diff --git a/files/zh-cn/web/api/comment/index.html b/files/zh-cn/web/api/comment/index.html new file mode 100644 index 0000000000..bf95530d67 --- /dev/null +++ b/files/zh-cn/web/api/comment/index.html @@ -0,0 +1,72 @@ +--- +title: Comment +slug: Web/API/Comment +tags: + - API + - DOM + - 参考 + - 注释 +translation_of: Web/API/Comment +--- +
{{ ApiRef("DOM") }}
+ +

Comment 接口代表标签(markup)之间的文本符号(textual notations)。尽管它通常不会显示出来,但是在查看源码时可以看到它们。在 HTML 和 XML 里,注释(Comments)为 '<!--' 和 '-->' 之间的内容。在 XML 里,注释中不能出现字符序列 '--'。

+ +

属性

+ +

该接口没有特定的属性,但是从其父类 {{domxref("CharacterData")}} 继承属性,以及间接从 {{domxref("Node")}} 继承部分属性。

+ +

构造函数

+ +
+
{{ domxref("Comment.Comment()", "Comment()") }} {{experimental_inline}}
+
使用文本内容作为参数,返回一个 Comment 对象。
+
+ +

方法

+ +

该接口没有特定的方法,但从其父类 {{domxref("CharacterData")}} 继承方法,以及间接从 {{domxref("Node")}} 继承部分方法。

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#comment', 'Comment')}}{{Spec2('DOM WHATWG')}}Added the constructor.
{{SpecName('DOM3 Core', 'core.html#ID-1728279322', 'Comment')}}{{Spec2('DOM3 Core')}}No change from {{SpecName('DOM2 Core')}}
{{SpecName('DOM2 Core', 'core.html#ID-1728279322', 'Comment')}}{{Spec2('DOM2 Core')}}No change from {{SpecName('DOM1')}}
{{SpecName('DOM1', 'level-one-core.html#ID-1728279322', 'Comment')}}{{Spec2('DOM1')}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("api.Comment")}}

+ +

参见

+ + -- cgit v1.2.3-54-g00ecf