Document.compatMode - Web APIs 编辑
The Document.compatMode
read-only 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
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论