例項屬性
繼承其父級 Node 的屬性。
DocumentType.name只讀-
文件的型別。對於 HTML 文件,它始終是
"html",但對於 XML 文件則會不同。 DocumentType.publicId只讀-
一個包含文件型別識別符號的字串。如果提供的 doctype 未指定 public ID,則為空。
DocumentType.systemId只讀-
包含關聯 DTD URL 的字串。如果提供的 doctype 未指定 system ID,則為空。
例項方法
繼承其父級 Node 的方法。
DocumentType.after()-
在當前節點的父級子節點列表中,在此節點之後插入一組
Node物件或字串。 DocumentType.before()-
在當前節點的父級子節點列表中,在此節點之前插入一組
Node物件或字串。 DocumentType.remove()-
從其父級子節點列表中移除此物件。
DocumentType.replaceWith()-
用一組給定的節點替換文件型別。
規範
| 規範 |
|---|
| DOM # interface-documenttype |
瀏覽器相容性
載入中…
另見
- DOM 介面索引。
DOMImplementation.createDocumentType()用於建立新的DocumentType節點。