setEndPoint Method
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
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus.
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.