English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
DOCTYPERead-only properties return the document type declaration (DTD) associated with the current document.
The returned object implements the DocumentType object.
The DocumentType object hasnameProperty, which returns the name of the doctype.
If there is no DTD associated with the current document, the doctype property returnsnull.
document.doctype
var doctypeObj = document.doctype; doctypeObj.name;Test to see‹/›
All browsers fully support the doctype property:
Property | |||||
doctype | Yes | Yes | Yes | Yes | Yes |
Return Value: | The document's doctype as a DocumentType object |
---|---|
DOM Version: | DOM Level1 |