Changes the end position of the range.
Syntax
object.moveEnd(Unit, Count)Standards information
There are no standards that apply here.
Parameters
- Unit [in]
-
Type: BSTR
String that specifies the units to move, using one of the following values:
character
-
Moves one or more characters.
word
-
Moves one or more words. A word is a collection of characters terminated by a space or some other white-space character, such as a tab.
sentence
-
Moves one or more sentences. A sentence is a collection of words terminated by a punctuation character, such as a period.
textedit
-
Moves to the start or end of the original range.
- Count [in, optional]
-
Type: long
Integer that specifies the number of units to move. This can be positive or negative. The default is 1.
Return value
Type: IntegerInteger that returns the number of units moved.
Remarks
This feature might not be available on non-Microsoft Win32 platforms.
See also
Send comments about this topic to Microsoft
Build date: 2/14/2012
var range = document.getElementById("aTextArea").createTextRange();
range.collapse(true);
range.moveStart('character', offsetIntoTextarea);
range.moveEnd('character', offsetPassedStart);
range.select();