document.compatMode

In this chapter you will learn:

  1. How to get the document compatibility mode in Javascript

document.compatMode

document.compatMode returns compatibility mode for the document.

<!DOCTYPE HTML> <!--from j  av  a2 s.co m-->
<html> 
    <body> 
        <script> 
            document.writeln("<pre>"); 
            document.writeln("compatMode: " + document.compatMode); 
            document.write("</pre>"); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to read and write cookies with Javascript
  2. How to use additional fields
Home » Javascript Tutorial » Document
Document Object
document.body
document.characterSet
document.charset
document.compatMode
document.cookie
document.defaultCharset
document.defaultView
getElementsByTagName(tagName)
document.getElementsByClassName
document.getElementsByName
document.images
document.lastModified
document.location
document.implementation
document.querySelectorAll
document.readyState
document.title
document.URL
document.writeln