Your Search Results



    Reports whether or not the specified editor query 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.


    • If the command has no value or is disabled, an empty string is returned.
    • The 'fontSize' command is handled specially; if its value override is set, that gets converted to an integer number of pixels and returned as a legacy font size.
    • 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].
    • If the command's value override is set, that gets returned.
    • Otherwise, the command's value is returned, as would be returned by document.queryCommandValue().


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

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
    Basic support 43+ 9.0 (9.0) [1] 4.0 ? ?
    Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
    Basic support ? 9.0 (9.0) ? ? ?

    [1] Before Firefox 41, for the command 'paste' Firefox incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.


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

    See also

    Document Tags and Contributors

    Last updated by: teoli,
    Hide Sidebar