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
76
77
78
79
80
81
82
83
84
85
86
87
88
|
---
title: DocumentType
slug: Web/API/DocumentType
tags:
- API
- DOM
- DocumentType
- Interface
translation_of: Web/API/DocumentType
---
<div>{{APIRef("DOM")}}</div>
<p><strong><code>DocumentType</code></strong> 介面表示了一個代表文件類型的 {{domxref("Node")}} 節點。</p>
<p>{{InheritanceDiagram}}</p>
<h2 id="屬性">屬性</h2>
<p><em>此介面繼承了其父介面 {{domxref("Node")}} 的屬性,以及實作了 {{domxref("ChildNode")}} 介面。</em></p>
<dl>
<dt>{{domxref("DocumentType.entities")}} {{readonlyInline}} {{obsolete_Inline}}</dt>
<dd>A {{domxref("NamedNodeMap")}} of entities declared in the DTD. Every node in this map implements the {{domxref("Entity")}} interface.</dd>
<dt>{{domxref("DocumentType.internalSubset")}} {{readonlyInline}} {{obsolete_Inline}}</dt>
<dd>A {{domxref("DOMString")}} of the internal subset, or <code>null</code> if there is none. Eg <code>"<!ELEMENT foo (bar)>"</code>.</dd>
<dt>{{domxref("DocumentType.name")}} {{readonlyInline}}</dt>
<dd>A {{domxref("DOMString")}}, eg <code>"html"</code> for <code><!DOCTYPE HTML></code>.</dd>
<dt>{{domxref("DocumentType.notations")}} {{readonlyInline}} {{obsolete_Inline}}</dt>
<dd>A {{domxref("NamedNodeMap")}} with notations declared in the DTD. Every node in this map implements the {{domxref("Notation")}} interface.</dd>
<dt>{{domxref("DocumentType.publicId")}} {{readonlyInline}}</dt>
<dd>A {{domxref("DOMString")}}, eg <code>"-//W3C//DTD HTML 4.01//EN"</code>, empty string for HTML5.</dd>
<dt>{{domxref("DocumentType.systemId")}} {{readonlyInline}}</dt>
<dd>A {{domxref("DOMString")}}, eg <code>"http://www.w3.org/TR/html4/strict.dtd"</code>, empty string for HTML5.</dd>
</dl>
<h2 id="方法">方法</h2>
<p><em>此介面繼承了其父介面 {{domxref("Node")}} 的方法,以及實作了 {{domxref("ChildNode")}} 介面。</em></p>
<dl>
<dt>{{domxref("ChildNode.remove()")}} {{experimental_inline}}</dt>
<dd>Removes the object from its parent children list.</dd>
</dl>
<h2 id="規範">規範</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', 'DocumentType')}}</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', 'DocumentType')}}</td>
<td>{{Spec2('DOM1')}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="瀏覽器相容性">瀏覽器相容性</h2>
{{Compat("api.DocumentType")}}
<h2 id="參見">參見</h2>
<ul>
<li><a href="/zh-TW/docs/DOM/DOM_Reference">The DOM interfaces index.</a></li>
<li>{{domxref("Entity")}}</li>
<li>{{domxref("Notation")}}</li>
</ul>
|