HTML DOM documentMode property
Document Object
Definition and Usage
The documentMode property returns the mode in which the browser renders the document.
IE8 renders pages in different ways, based on the !DOCTYPE or certain existing HTML elements.
The return values for these elements are as follows:
- 5 - The page is displayed in IE5 mode
- 7 - The page is displayed in IE7 mode
- 8 - The page is displayed in IE8 mode
- 9 - The page is displayed in IE9 mode
Note: If no !DOCTYPE is specified, IE8 renders the page in IE5 mode.
Syntax
document.documentMode
Browser support





documentMode is an IE-specific property supported by IE8 and later IE versions.
Example
Example
Return the mode used by the browser to render the page:
This document is displayed in:
Try it »
Document Object