1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
---
title: Comment
slug: Web/API/Comment
tags:
- API
- DOM
- NeedsTranslation
- Reference
- TopicStub
translation_of: Web/API/Comment
---
<div>{{ ApiRef("DOM") }}</div>
<p><span class="seoSummary">The <code><strong>Comment</strong></code> interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view.</span> Comments are represented in HTML and XML as content between '<code><!--</code>' and '<code>--></code>'. In XML, the character sequence '<code>--</code>' cannot be used within a comment.</p>
<p>{{InheritanceDiagram}}</p>
<h2 id="Properties">Properties</h2>
<p><em>This interface has no specific property, but inherits those of its parent, {{domxref("CharacterData")}}, and indirectly those of {{domxref("Node")}}.</em></p>
<h2 id="Constructor">Constructor</h2>
<dl>
<dt>{{ domxref("Comment.Comment()", "Comment()") }} {{experimental_inline}}</dt>
<dd>Returns a <code>Comment</code> object with the parameter as its textual content.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>This interface has no specific method, but inherits those of its parent, {{domxref("CharacterData")}}, and indirectly those of {{domxref("Node")}}.</em></p>
<h2 id="Specification" name="Specification">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('DOM WHATWG', '#comment', 'Comment')}}</td>
<td>{{Spec2('DOM WHATWG')}}</td>
<td>Added the constructor.</td>
</tr>
<tr>
<td>{{SpecName('DOM3 Core', 'core.html#ID-1728279322', 'Comment')}}</td>
<td>{{Spec2('DOM3 Core')}}</td>
<td>No change from {{SpecName('DOM2 Core')}}</td>
</tr>
<tr>
<td>{{SpecName('DOM2 Core', 'core.html#ID-1728279322', 'Comment')}}</td>
<td>{{Spec2('DOM2 Core')}}</td>
<td>No change from {{SpecName('DOM1')}}</td>
</tr>
<tr>
<td>{{SpecName('DOM1', 'level-one-core.html#ID-1728279322', 'Comment')}}</td>
<td>{{Spec2('DOM1')}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.Comment")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en-US/docs/Web/API/Document_Object_Model" title="/en-US/docs/DOM/DOM_Reference">The DOM interfaces index</a></li>
</ul>
|