JavaScript Reference/Javascript Methods/moveEnd

Материал из Web эксперт
Версия от 11:22, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"moveEnd()" Example

   <source lang="javascript">
   

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

   range = myText.createTextRange();
   var m = range.moveEnd("textedit");
   range.select(); 

} </script> <input id="myText" type="text" value="Some sample text. This text is editable" size="50"> <input type="button" value="Select the text inside the textbox" onclick="function1();"> </body> </html>


     </source>
   
  


"moveEnd()" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |TextRange | +----------------+--------------------------------------------------------------+

     </source>
   
  


"moveEnd()" Syntax, Parameters and Note

   <source lang="javascript">

Note: Moves the end position of a text to a new location and returns the number of units moved.

Syntax:

textRangeName.moveEnd(param1, param2) Parameters:

   param1   Required; the type of units to move. 
                      character, 
                      word, 
                      sentence, 
                      textedit             start or end of the text range
   param2   Optional; the number of units to move.
   
     
     </source>