Sets the end point of one range based on the end point of another range.
Syntax
textRange.setEndPoint(sType, oTextRange)
Parameters
sType Required. String that specifies the end point to transfer, using one of the following values:
StartToEnd Move the start of the TextRange object to the end of the specified oTextRange parameter. StartToStart Move the start of the TextRange object to the start of the specified oTextRange parameter. EndToStart Move the end of the TextRange object to the start of the specified oTextRange parameter. EndToEnd Move the end of the TextRange object to the end of the specified oTextRange parameter. oTextRange Required. TextRange object that specifies the range from which the source end point is to be taken.
Return Value
No return value.
Remarks
A text range has two end points: one at the beginning of the text range and one at the end. An end point also can be the position between two characters in an HTML document.
In Microsoft® Internet Explorer 4.0, an end point is relative to text only, not HTML tags.
There are four possible end-point locations in the following HTML:
<BODY><P><B>abcThe possible end-point locations are:
- Before the letter a.
- Between the letters a and the b.
- Between the letters b and the c.
- After the letter c.
In Internet Explorer 4.0, an end point cannot be established between the BODY and the P, for example. Such an end point would be considered to occur before the letter a.
This method might not be available on non-Win32® platforms. For the latest information about Internet Explorer cross-platform compatibility, see article Q172976 in the Microsoft Knowledge Base.
Example
This example uses the setEndPoint method to set the start point of the current range (r1) to the end point of the second range (r2).
<SCRIPT LANGUAGE="JScript"> r1.setEndPoint("StartToEnd", r2); </SCRIPT>
Applies To