--- title: DocumentType slug: Web/API/DocumentType tags: - API - DOM - DocumentType - Interface translation_of: Web/API/DocumentType ---
DocumentType 介面表示了一個代表文件類型的 {{domxref("Node")}} 節點。
{{InheritanceDiagram}}
此介面繼承了其父介面 {{domxref("Node")}} 的屬性,以及實作了 {{domxref("ChildNode")}} 介面。
null if there is none. Eg "<!ELEMENT foo (bar)>"."html" for <!DOCTYPE HTML>."-//W3C//DTD HTML 4.01//EN", empty string for HTML5."http://www.w3.org/TR/html4/strict.dtd", empty string for HTML5.此介面繼承了其父介面 {{domxref("Node")}} 的方法,以及實作了 {{domxref("ChildNode")}} 介面。
| 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', 'DocumentType')}} | {{Spec2('DOM2 Core')}} | Added the publicID, systemID, and internalSubset properties. |
| {{SpecName('DOM1', 'level-one-core.html#ID-412266927', 'DocumentType')}} | {{Spec2('DOM1')}} | Initial definition |