HTML DOM Document doctype property
- Προηγούμενη Σελίδα designMode
- Επόμενη Σελίδα documentElement
- Επιστροφή στο Προηγούμενο επίπεδο HTML DOM Documents
Definition and usage
doctype
The property returns the doctype of the document (as a DocumentType object).
If the document does not have a doctype, then doctype
The property returns null.
doctype
The property is read-only.
doctype.name
The property returns the name of the doctype.
See also:
Example
Get the doctype name of the HTML document:
const doctypeObj = document.doctype.name;
Syntax
document.doctype
Return value
Type | Description |
---|---|
Object | DocumentType object. |
Browser support
document.doctype
It is a DOM Level 1 (1998) feature.
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Υποστήριξη | 9-11 | Υποστήριξη | Υποστήριξη | Υποστήριξη | Υποστήριξη |
- Προηγούμενη Σελίδα designMode
- Επόμενη Σελίδα documentElement
- Επιστροφή στο Προηγούμενο επίπεδο HTML DOM Documents