document.queryCommandSupported

« Gecko DOM Reference

Summary

Reports whether or not the specified editor query command is supported by the browser.

Syntax

var isSupported = document.queryCommandSupported(command);
command
The command for which to determine support.

If the command is not supported, a NotSupportedError exception is thrown.

Otherwise:

  • 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.
  • 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() .

Example

Example needed

Browser compatibility

  • Desktop
  • Mobile

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 9.0 (9.0) 4.0 ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 9.0 (9.0) ? ? ?

Tags (3)

Edit tags

Attachments (0)

 

Attach file