Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
The Document.queryCommandSupported()
method reports whether or not the specified editor command is supported by the browser.
Syntax
isSupported = document.queryCommandSupported(command);
-
Parameters
command
- The command for which to determine support.
Return value
Returns a Boolean
which is true
if the command is supported and false
if the command isn't.
Notes
The 'paste'
command return false
not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action [1]
Example
var flg = document.queryCommandSupported("SelectAll"); if(flg) { // ...Do something }
Specifications
Specification | Status | Comment |
---|---|---|
execCommand |
Browser compatibility
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
queryCommandSupported | Chrome Full support 1 | Edge Full support 12 | Firefox
Full support
41
| IE Full support 4 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android
Full support
41
| Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.
- See implementation notes.
- See implementation notes.