Document: compatMode プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Document.compatMode
プロパティは、文書が後方互換モード(Quirks モード)と標準準拠モードのどちらで表示されているかを示します。
値
列挙値で、次の値を取ります。
- "
BackCompat
" 文書が後方互換モードの場合。 - "
CSS1Compat
" 文書が後方互換モードでない(標準準拠モードとも呼ばれる)または限定互換モード(「ほぼ標準準拠」モードとも呼ばれる)場合。
メモ: これらのモードはすべて標準で定義されましたので、より古い "standards" および "almost standards" の名前は無意味であり、もう標準では使用されません。
例
js
if (document.compatMode === "BackCompat") {
// 互換モード
}
仕様書
Specification |
---|
DOM # ref-for-dom-document-compatmode① |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
compatMode |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
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.