Javascript Reference
Categories: TextRange

javascript TextRange moveEnd( ), moveStart( )

@May 24, 2008, 11:54 a.m.
moveEnd( ), moveStart( ) Firefox/Netscape/NN n/a IE 4(Win) Chrome/Safari/DOM n/a  

moveEnd("unit"[, count]) moveStart("unit"[, count])

  

Moves only the end or start point (respectively) of the current text range by one or more units. An optional parameter lets you specify both the number of units and direction. To shift the start point of a text range toward the beginning of the original range, be sure to specify a negative value. When moving the end point forward by word units, be aware that a word ends with a whitespace character (including a period). Therefore, if a findText( ) method sets the range to a found string that does not end in a space, the first moveEnd("word") method moves the ending point to the spot past the space after the found string rather than to the following word.

 
Parameters
 
  • A case-insensitive string value of the desired unit: character | word | sentence | textedit. The textedit value moves the insertion pointer to the start or end of the entire original range.
  • An optional integer of the number of units to move the insertion pointer. Positive values move the pointer forward; negative values move the pointer backward. Default value is 1.
 
Returned Value

Integer of the number of units moved.

[Darius: Can i have an example of this properties??I want see an example of the use of optional ...]
moveEnd("word",1);
moveEnd("word",20);
moveEnd("word",-5);
javascript manual - 2009-05-14
Can i have an example of this properties??

I want see an example of the use of optional interger... the second case! :)

Tnks!!
Darius - 2008-12-12

Powered by Linode.