How to get the document compatibility mode in Javascript

document.compatMode

document.compatMode returns compatibility mode for the document.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
            document.writeln("<pre>"); 
            document.writeln("compatMode: " + document.compatMode); 
            document.write("</pre>"); 
        </script> 
    </body> 
</html><!--from   w  w w. ja  v  a 2 s. com-->

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window