Document.queryCommandState()
已弃用: 不再推荐使用该特性。虽然一些浏览器仍然支持它,但也许已从相关的 web 标准中移除,也许正准备移除或出于兼容性而保留。请尽量不要使用该特性,并更新现有的代码;参见本页面底部的兼容性表格以指导你作出决定。请注意,该特性随时可能无法正常工作。
语法
js
Object.queryCommandState(String command)
描述
返回 指定命令 在对象内的状态码(1 表示指定命令在对象内已执行;0 表示指定命令在对象内未执行,处于可执行状态;-1 表示指定命令在对象内处于不可用状态)
规范
此特性不属于任何规范,也不再有望被标准化。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
queryCommandState |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Non-standard. Check cross-browser support before using.
- Deprecated. Not for use in new websites.
- 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.
参见
document.contentEditable
document.designMode
- Rich-Text Editing in Mozilla
- Browser bugs related to
queryCommandState()
: Scribe's "Browser Inconsistencies" documentation