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 962597 of DocumentType

  • Revision slug: Web/API/DocumentType
  • Revision title: DocumentType
  • Revision id: 962597
  • Created:
  • Creator: Sebastianz
  • Is current revision? No
  • Comment Fixed page formatting and browser compatibility note referencing

Revision Content

{{APIRef("DOM")}}

The DocumentType interface represents a {{domxref("Node")}} containing a doctype.

Properties

Inherits properties from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.

...
{{domxref("DocumentType.entities")}} {{readonlyInline}} {{deprecated_Inline}}
...
{{domxref("DocumentType.name")}} {{readonlyInline}}
...
{{domxref("DocumentType.notations")}} {{readonlyInline}} {{deprecated_Inline}}
...
{{domxref("DocumentType.publicId")}} {{readonlyInline}}
...
{{domxref("DocumentType.systemId")}} {{readonlyInline}}
...

Methods

Inherits methods from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.

{{domxref("ChildNode.remove()")}} {{experimental_inline}}
Removes the object from its parent children list.

Specifications

Specification Status Comment
{{SpecName('DOM WHATWG', '#documenttype', 'DocumentType')}} {{Spec2('DOM WHATWG')}} Added implemention of the {{domxref("ChildNode")}} interface.
Removed the internalSubset, entities, and notation properties.
{{SpecName('DOM3 Core', 'core.html#ID-412266927', 'DocumentType')}} {{Spec2('DOM3 Core')}} No change from {{SpecName('DOM2 Core')}}.
{{SpecName('DOM2 Core', 'core.html#ID-412266927', 'CharacterData')}} {{Spec2('DOM2 Core')}} Added the publicID, systemID, and internalSubset properties.
{{SpecName('DOM1', 'level-one-core.html#ID-412266927', 'CharacterData')}} {{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}}
entities and notations 1.0[1] {{CompatGeckoDesktop("1.0")}}
{{CompatNo}}{{CompatGeckoDesktop("6.0")}}
{{CompatUnknown}} {{CompatVersionUnknown}}[1] {{CompatVersionUnknown}}
Implements {{domxref("ChildNode")}} 29.0 {{CompatGeckoDesktop("25.0")}}[2] {{CompatNo}} 16.0 {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
entities and notations {{CompatVersionUnknown}}[1] {{CompatGeckoMobile("1.0")}}
{{CompatNo}}{{CompatGeckoMobile("6.0")}}
{{CompatUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Implements {{domxref("ChildNode")}} 29.0 {{CompatGeckoMobile("25.0")}}[2] {{CompatNo}} 16.0 {{CompatNo}}

[1] The Chromium project plans to drop supports for the internalSubset, entities and notations methods.

[2] Firefox 25 also added the previousElementSibling and nextElementSibling properties, this was removed in Firefox 28 due to compatibility problems.

See also

Revision Source

<div>{{APIRef("DOM")}}</div>

<p>The <strong><code>DocumentType</code></strong> interface represents a {{domxref("Node")}} containing a doctype.</p>

<h2 id="Properties">Properties</h2>

<p><em>Inherits properties from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.</em></p>

<dl>
 <dt>...</dt>
 <dt>{{domxref("DocumentType.entities")}} {{readonlyInline}} {{deprecated_Inline}}</dt>
 <dd>...</dd>
 <dt>{{domxref("DocumentType.name")}} {{readonlyInline}}</dt>
 <dd>...</dd>
 <dt>{{domxref("DocumentType.notations")}} {{readonlyInline}} {{deprecated_Inline}}</dt>
 <dd>...</dd>
 <dt>{{domxref("DocumentType.publicId")}} {{readonlyInline}}</dt>
 <dd>...</dd>
 <dt>{{domxref("DocumentType.systemId")}} {{readonlyInline}}</dt>
 <dd>...</dd>
</dl>

<h2 id="Specification">Methods</h2>

<p><em>Inherits methods from its parent, {{domxref("Node")}}, and implements the {{domxref("ChildNode")}} interface.</em></p>

<dl>
 <dt>{{domxref("ChildNode.remove()")}} {{experimental_inline}}</dt>
 <dd>Removes the object from its parent children list.</dd>
</dl>

<h2 id="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', '#documenttype', 'DocumentType')}}</td>
   <td>{{Spec2('DOM WHATWG')}}</td>
   <td>Added implemention of the {{domxref("ChildNode")}} interface.<br />
    Removed the <code>internalSubset</code>, <code>entities</code>, and <code>notation</code> properties.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM3 Core', 'core.html#ID-412266927', 'DocumentType')}}</td>
   <td>{{Spec2('DOM3 Core')}}</td>
   <td>No change from {{SpecName('DOM2 Core')}}.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM2 Core', 'core.html#ID-412266927', 'CharacterData')}}</td>
   <td>{{Spec2('DOM2 Core')}}</td>
   <td>Added the <code>publicID</code>, <code>systemID</code>, and <code>internalSubset</code> properties.</td>
  </tr>
  <tr>
   <td>{{SpecName('DOM1', 'level-one-core.html#ID-412266927', 'CharacterData')}}</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>entities</code> and <code>notations</code></td>
   <td>1.0<sup>[1]</sup></td>
   <td>{{CompatGeckoDesktop("1.0")}}<br />
    {{CompatNo}}{{CompatGeckoDesktop("6.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}<sup>[1]</sup></td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td>Implements {{domxref("ChildNode")}}</td>
   <td>29.0</td>
   <td>{{CompatGeckoDesktop("25.0")}}<sup>[2]</sup></td>
   <td>{{CompatNo}}</td>
   <td>16.0</td>
   <td>{{CompatNo}}</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>entities</code> and <code>notations</code></td>
   <td>{{CompatVersionUnknown}}<sup>[1]</sup></td>
   <td>{{CompatGeckoMobile("1.0")}}<br />
    {{CompatNo}}{{CompatGeckoMobile("6.0")}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatVersionUnknown}}</td>
  </tr>
  <tr>
   <td>Implements {{domxref("ChildNode")}}</td>
   <td>29.0</td>
   <td>{{CompatGeckoMobile("25.0")}}<sup>[2]</sup></td>
   <td>{{CompatNo}}</td>
   <td>16.0</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] The Chromium project plans to drop supports for the <code>internalSubset</code>, <code>entities</code> and <code>notations</code> methods.</p>

<p>[2] Firefox 25 also added the <code>previousElementSibling</code> and <code>nextElementSibling properties</code>, this was removed in Firefox 28 due to compatibility problems.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/DOM/DOM_Reference">The DOM interfaces index.</a></li>
</ul>
Revert to this revision