The documentMode is an IE only property.
Return the mode used to render the current document:
var x = document.documentMode;
The documentMode property is only supported in Internet Explorer, from IE8+.
<!DOCTYPE html> <html> <body> <p>This document is displayed in IE<span id="demo"></span> mode.</p> <script> var x = document.documentMode; document.getElementById("demo").innerHTML = x; </script>//from ww w.j a va 2 s. c om </body> </html>
The documentMode property returns the mode used by the browser to render the current document.
This property returns one of following values:
If no !DOCTYPE is specified, IE8 renders the page in IE5 mode!