Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Executes a command on the current document, current selection, or the given range.
Syntax
bSuccess = object .execCommand( sCommand [ , bUserInterface ] [ , vValue ] )Parameters
sCommand | Required. String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. | ||||
bUserInterface | Optional. Boolean that specifies one of the following values.
|
||||
vValue | Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on sCommand . |
Return Value
Returns True if the command is successful.
Remarks
Do not invoke the execCommand method until after the page loads.
The bUserInterface and vValue parameters might be required depending on the command being executed.
Example
The following example shows how to use the CreateLink constant as the sCommand of the execCommand method to allow the user to create a hyperlink from selected text. The scriptMicrosoft® JScript® then retrieves the specified URL and uses it to replace the selected text.
<HTML>
Standards Information
There is no public standard that applies to this method.
Applies To
|
document , controlRange , TextRange |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |