X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM doctype Property

Document Object Reference Document Object

Example

Return the doctype object of an HTML document:

document.doctype;

Try it yourself »


Definition and Usage

The doctype property returns the doctype of the HTML document, as a DocumentType object.

Read more about the DocumentType object in our DocumentType object reference.

Note: If the document has no doctype specified, the return value is null.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The doctype property is supported in all major browsers.

Note: In Internet Explorer 8 and earlier, this property returns null for HTML and XHTML documents, and will only work for XML documents.


Syntax

document.doctype

Technical Details

Return Value: The document's doctype, as a DocumentType object.
DOM Version Core Level 1 Document Object


Document Object Reference Document Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook