JavaScript Reference/Javascript Methods/queryCommandValue

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

"queryCommandValue()" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript"> function function1() {

   var myText = document.body.createTextRange();
   var m = myText.queryCommandValue("delete");
   alert("The command value for this object is: "+"""+m+"""); 

} </script> <input type="button" value="Delete Command Value" onclick="function1();"> </body> </html>


     </source>
   
  


"queryCommandValue()" is applied to

   <source lang="javascript">

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

     </source>
   
  


"queryCommandValue()" Syntax, Parameters and Note

   <source lang="javascript">

Note: This method returns the value of the specified command.

Syntax:

controlRangeName.queryCommandValue(param1) objectName.queryCommandValue(param1) Parameters:

   param1   Required; the name of the command. 
                      For a complete list of commands, go to: 
                      http://msdn.microsoft.ru/workshop/author/dhtml/reference/commandids.asp.
   
     
     </source>