--- 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 ,例:"<!ELEMENT foo (bar)>"<!DOCTYPE HTML>中的“html”"-//W3C//DTD HTML 4.01//EN"。"http://www.w3.org/TR/html4/strict.dtd"。继承方法自父节点,{{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', 'CharacterData')}} | {{Spec2('DOM2 Core')}} | Added the publicID, systemID, and internalSubset properties. |
| {{SpecName('DOM1', 'level-one-core.html#ID-412266927', 'CharacterData')}} | {{Spec2('DOM1')}} | Initial definition |
{{Compat("api.DocumentType")}}