Latest web development tutorials

HTML DOM documentMode property

Document Object Reference Document Object

Definition and Usage

documentMode property returns the browser rendering mode documents.

IE8 render pages using a different way, based on! DOCTYPE HTML or some elements exist.

These elements return values ​​are as follows:

  • 5 - page display mode in IE5
  • 7-- page display mode in IE7
  • 8 - page display mode in IE8
  • 9 - page display mode in IE9

!Note: If you do not specify a DOCTYPE, IE8 render pages in IE5 mode.

grammar

document.documentMode


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

documentMode browser is IE specific properties after IE8 and the IE versions support this property.


Examples

Examples

Return to the browser page rendering mode to use:

<html>
<body>

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

</body>
</html>

try it"


Document Object Reference Document Object