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

HTML DOM documentMode Property

Document Object Reference Document Object

Definition and Usage

The documentMode property returns the mode used by the browser to render the current document.

IE8 can render a page in different modes, depending on the !DOCTYPE or the presence of certain HTML elements.

This property returns one of following values:

  • 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

Internet Explorer Firefox Opera Google Chrome Safari

The documentMode is an IE only property, supported in IE8+.


Example

Example

Return the mode used by the browser to render the current document:

<html>
<body>

This document is displayed in:
<script>
document.write(document.documentMode);
</script>

</body>
</html>

Try it yourself »


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

SHARE THIS PAGE