HTML DOM doctypeProperty
Definition and Usage
The doctype property returns the Document Type Declaration associated with the document.
For more information about the DocumentType object, see theDocumentType Object Reference.
Note:If the document does not specify a document type, the return value isnull.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the doctype property
Note:When Internet Explorer 8 and earlier versions display HTML and XHTML documents, this property returnsnull, but supports XML documents.
Syntax
document.doctype
Technical Details
| Return Value: | The document type of the document, as a DocumentType object. |
|---|---|
| DOM Version | Core Level 1 Document Object |
Other Extensions
Document Object