Skip to content
Related Articles

Related Articles

HTML | DOM documentMode Property

Improve Article
Save Article
  • Last Updated : 24 Jul, 2019
Improve Article
Save Article

The DOM documentMode property in HTML is an IE8 property that is used to detect the document mode used by the browser to render the current page. It returns a different number depending on the mode of the page in which it is being rendered because IE8 can render a page in various different modes depending on the page’s doctype plus the presence of certain HTML element’s.

This property returns certain values depending on which version of IE we are using.

  • If the page is running in IE5 than value displayed will be – 5
  • If the page is running in IE7 than value displayed will be – 7
  • If the page is running in IE8 than value displayed will be – 8

Note: By default the page is rendered in IE5 mode if !DOCTYPE is not specified.



<!DOCTYPE html>
        <title>DOM documentMode Property</title>
    <body style = "text-align: center;">
        <h1 style = "color:green;">GeeksforGeeks</h1>
        <h2>DOM documentMode Property</h2>
        This document is displayed in IE 
        <span id="geek"></span> mode.
            var docMode = document.documentMode;
            document.getElementById("geek").innerHTML =


Supported Browsers: The documentMode property is only supported by Internet Explorer.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!