queryCommandEnabled

queryCommandEnabled method

Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.

Syntax

object.queryCommandEnabled(cmdID)

Parameters

cmdID [in]

Type: String

String that specifies a command identifier.

Return value

Type: Boolean

Boolean that returns one of the following possible values:

Return valueDescription
true

The command is enabled.

false

The command is disabled.

 

Standards information

There are no standards that apply here.

Remarks

Using queryCommandEnabled ("delete") on a TextRange object returns true, while queryCommandEnabled ("delete") on a document object returns false. However, execCommand ("delete") can still be used to delete the selected text.

See also

controlRange
document
TextRange
Reference
execCommand
queryCommandIndeterm
queryCommandState
queryCommandSupported
queryCommandValue

 

 

Show:
© 2017 Microsoft