翻譯不完整。請協助 翻譯此英文文件

DocumentType 介面表示了一個代表文件類型的 Node 節點。

屬性

此介面繼承了其父介面 Node 的屬性,以及實作了 ChildNode 介面。

DocumentType.entities Read only
A NamedNodeMap of entities declared in the DTD. Every node in this map implements the Entity interface.
DocumentType.internalSubset Read only
A DOMString of the internal subset, or null if there is none. Eg "<!ELEMENT foo (bar)>".
DocumentType.name Read only
A DOMString, eg "html" for <!DOCTYPE HTML>.
DocumentType.notations Read only
A NamedNodeMap with notations declared in the DTD. Every node in this map implements the Notation interface.
DocumentType.publicId Read only
A DOMString, eg "-//W3C//DTD HTML 4.01//EN", empty string for HTML5.
DocumentType.systemId Read only
A DOMString, eg "http://www.w3.org/TR/html4/strict.dtd", empty string for HTML5.

方法

此介面繼承了其父介面 Node 的方法,以及實作了 ChildNode 介面。

ChildNode.remove()
Removes the object from its parent children list.

規範

Specification Status Comment
DOM
The definition of 'DocumentType' in that specification.
Living Standard Added implemention of the ChildNode interface.
Removed the internalSubset, entities, and notation properties.
Document Object Model (DOM) Level 3 Core Specification
The definition of 'DocumentType' in that specification.
Obsolete No change from Document Object Model (DOM) Level 2 Core Specification.
Document Object Model (DOM) Level 2 Core Specification
The definition of 'DocumentType' in that specification.
Obsolete Added the publicID, systemID, and internalSubset properties.
Document Object Model (DOM) Level 1 Specification
The definition of 'DocumentType' in that specification.
Obsolete Initial definition

瀏覽器相容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

        
Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 (Yes) 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
entities and notations 1.0[1] (Yes)[3] 1.0 (1.7 or earlier)
No support6.0 (6.0)
(Yes)[3] (Yes)[1] (Yes)
internalSubset ? (Yes) No support (not anymore in any case) (Yes) ? ?
Implements ChildNode 29.0 (Yes) 25.0 (25.0)[2] No support 16.0 No support
        
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
entities and notations (Yes)[1] (Yes) 1.0 (1.0)
No support6.0 (6.0)
? (Yes) (Yes)
internalSubset ? ? ? ? ? ?
Implements ChildNode (Yes) (Yes) 25.0 (25.0)[2] No support 16.0 No support

[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.

[3] entities and notations properties exist in IE and Edge, but seem to always be null?

參見

文件標籤與貢獻者

此頁面的貢獻者: jackblackevo
最近更新: jackblackevo,