JavaScript Reference/Javascript Methods/execCommand

Материал из Web эксперт
Перейти к: навигация, поиск

"execCommand()" Example

<script language="JavaScript">
function function1() {
    document.execCommand("Refresh", "false", "false");
<button onclick="function1();">Refresh page</button>

"execCommand()" is applied to

Names noted with an asterisk (*) are JavaScript properties only.
| Applied_To     |controlRange*                   document                      |
|                |TextRange                                                     |

"execCommand()" Syntax, Parameters and Note

Executes outside the regular methods. 
Returns true (successful) or false (failed).
controlRangeName.execCommand(param1, param2, param3)
objectName.execCommand(param1, param2, param3)

    param1   Required; the name of the command. 
    param2   Optional; true or false, display a user interface 
                       if the command supports one.
    param3   Optional; only applies to some of the commands.