We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS


The Document.queryCommandSupported() method reports whether or not the specified editor command is supported by the browser.


isSupported = document.queryCommandSupported(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.


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]


var flg = document.queryCommandSupported("SelectAll");

if(flg) {
  // ...Do something


Specification Status Comment
HTML Editing APIs
The definition of 'querycommandsupported' in that specification.
Editor's Draft Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support17 Yes


9 — 411

4 ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes


9 — 411

? ? ?

1. paste argument incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.

See also

Document Tags and Contributors

Last updated by: fscholz,