compatMode property (document)
Returns whether rendering works in Quirks or Strict mode.
The rendering mode of a document depends on the doctype declaration and the currently used browser.
If rendering works in Strict mode, then the document is rendered according to the W3C standards.
This rendering mode can cause problems in older browsers.
If the document is rendered in Quirks mode, then the behavior of older browsers is emulated.
To get detailed description about the Quirks and Strict modes, visit this page: Quirks mode (Wikipedia)
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read-only.
Possible values:
String that represents the rendering mode.
One of the following values:
Document is rendered in Quirks mode. | |||||||
Document is rendered in Strict mode. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the compatMode property:
|
||||
<head> <script type="text/javascript"> function GetRenderingMode () { var compMode = (document.compatMode == "BackCompat")? "Quirks" : "Strict"; alert ("The document is rendered in " + compMode + " mode."); } </script> </head> <body> <button onclick="GetRenderingMode ();">Get rendering mode</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments