Indicates whether the document is rendered in Quirks mode or Standards mode.
Syntax
mode = document.compatMode;
Values
mode- Is 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 defined in standards, 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
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.
Update compatibility data on GitHub
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Chrome Full support Yes | Edge ? | Firefox Full support Yes | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile ? | Firefox Android Full support Yes | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.