--- title: Document.queryCommandState() slug: Web/API/Document/queryCommandState translation_of: Web/API/Document/queryCommandState ---
{{ApiRef("DOM")}}

语法

Object.queryCommandState(String command)

描述

返回 指定命令 在对象内的状态码(1表示指定命令在对象内已执行;0表示指定命令在对象内未执行,处于可执行状态;-1表示指定命令在对象内处于不可用状态)

规范

Specification Status Comment
{{SpecName('HTML Editing','#execcommand()','execCommand')}} {{Spec2('HTML Editing')}} Initial definition

浏览器兼容性

{{CompatibilityTable}}

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

参见