Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

HTML DOM doctype Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The DOM doctype property is used to return the doctype of any HTML document. The DocumentType object is the name property used to return the name of the object. If there is no doctype declared in the document then it returns a Null value. 



Example: In this example, we will use the doctype property for getting the doctype of HTML.


<!DOCTYPE html.5>
    <title>DOM doctype Property</title>
        h2 {
            color: green;
<body style="text-align:center;">
    <h2>DOM doctype Property</h2>
    <button onclick="geeks()">Submit</button>
    <p id="sudo"></p>
        function geeks() {
            let gfg =;
            document.getElementById("sudo").innerHTML = gfg;


HTML DOM doctype Property

HTML DOM doctype Property

Supported Browsers: The browser supported by DOM doctype property are listed below:

  • Google Chrome 1
  • Edge 12
  • Internet Explorer 6
  • Firefox 1
  • Opera 12.1
  • Safari 1
My Personal Notes arrow_drop_up
Last Updated : 09 Jun, 2023
Like Article
Save Article
Similar Reads
Related Tutorials