Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 453439 of Comment

  • Revision slug: Web/API/Comment
  • Revision title: Comment
  • Revision id: 453439
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment
Tags: 

Revision Content

{{DOMRef()}}

The Comment interface represents textual notations within markup; although it is generally not displayed, it is still 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.

Properties

This interface has no specific property, but inherits those of its parent, {{domxref("CharacterData")}}, and indirectly those of {{domxref("Node")}}.

Constructor

{{ domxref("Comment.Comment()", "Comment()") }} {{experimental_inline}}
Returns a Comment object with the parameter as its textual content.

Methods

This interface has no specific method, but inherits those of its parent, {{domxref("CharacterData")}}, and indirectly those of {{domxref("Node")}}.

Specifications

Specification Status Comment
{{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

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Comment() constructor {{experimental_inline}} {{CompatUnknown}} {{CompatGeckoDesktop("24.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Comment() constructor {{experimental_inline}} {{CompatUnknown}} {{CompatGeckoMobile("24.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also

 

Revision Source

<p>{{DOMRef()}}</p>
<p>The <code><strong>Comment</strong></code> interface represents textual notations within markup; although it is generally not displayed, it is still available to be read in the source view.&nbsp; Comments are represented in HTML and XML as content between '<code>&lt;!--</code>' and '<code>--&gt;</code>'. In XML, the character sequence '<code>--</code>' cannot be used within a comment.</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>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>{{CompatibilityTable}}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>{{CompatGeckoDesktop("1.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>Comment()</code> constructor {{experimental_inline}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatGeckoDesktop("24.0")}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatGeckoMobile("1.0")}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>Comment()</code> constructor {{experimental_inline}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatGeckoMobile("24.0")}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
        <td>{{CompatUnknown}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/DOM/DOM_Reference" title="/en-US/docs/DOM/DOM_Reference">The DOM interfaces index</a></li>
</ul>
<p>&nbsp;</p>
Revert to this revision