From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/document/querycommandsupported/index.html | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 files/zh-cn/web/api/document/querycommandsupported/index.html (limited to 'files/zh-cn/web/api/document/querycommandsupported') diff --git a/files/zh-cn/web/api/document/querycommandsupported/index.html b/files/zh-cn/web/api/document/querycommandsupported/index.html new file mode 100644 index 0000000000..de033d485c --- /dev/null +++ b/files/zh-cn/web/api/document/querycommandsupported/index.html @@ -0,0 +1,116 @@ +--- +title: Document.queryCommandSupported() +slug: Web/API/Document/queryCommandSupported +tags: + - 包括示例 + - 编辑器 +translation_of: Web/API/Document/queryCommandSupported +--- +
{{ ApiRef("DOM") }}
+ +
 
+ +

Document.queryCommandSupported() 方法确定浏览器是否支持指定的编辑指令。

+ +

语法

+ +
isSupported = document.queryCommandSupported(command);
+
+ +
+
command
+
待确定是否支持的命令。
+
+ +

如果命令不被支持,将触发 NotSupportedError 异常。

+ +

另外:

+ + + +

示例

+ +
var flg = document.queryCommandSupported("SelectAll");
+
+if(flg) {
+  // ...Do something
+}
+
+ +

浏览器兼容性

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
特性ChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatUnknown}}{{CompatGeckoDesktop("9.0")}}4.0{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
特性AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatGeckoMobile("9.0")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

规范

+ + + + + + + + + + + + + + +
规范状态备注
{{SpecName('HTML Editing','#querycommandsupported()','querycommandsupported')}}{{Spec2('HTML Editing')}} 
+ +

参见

+ + -- cgit v1.2.3-54-g00ecf