The Document.compatMode
property indicates whether the document is rendered in Quirks mode or Standards mode.
Syntax
const mode = document.compatMode
Value
An enumerated value that can be:
- "
BackCompat
" if the document is in quirks mode. - "
CSS1Compat
" if the document is in no-quirks (also known as "standards") mode or limited-quirks (also known as "almost standards") mode.
Note: All these modes are now standardized, so the older "standards" and "almost standards" names are nonsensical and no longer used in standards.
Example
if (document.compatMode == "BackCompat") { // in Quirks mode }
Specifications
Specification | Status | Comment |
---|---|---|
DOM The definition of 'compatMode' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
compatMode | Chrome Full support 43 | Edge Full support 12 | Firefox Full support Yes | IE ? | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 43 | Chrome Android Full support 43 | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 4.0 |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.