Click to return to the DHTML, HTML     
setData Method     setExpression Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

setEndPoint Method


Sets the end point of one range based on the end point of another range.

Syntax

textRange.setEndPoint(sType, oTextRange)

Parameters

sTypeRequired. String that specifies the end point to transfer, using one of the following values:
StartToEndMove the start of the TextRange object to the end of the specified oTextRange parameter.
StartToStartMove the start of the TextRange object to the start of the specified oTextRange parameter.
EndToStartMove the end of the TextRange object to the start of the specified oTextRange parameter.
EndToEndMove the end of the TextRange object to the end of the specified oTextRange parameter.
oTextRangeRequired. 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>abc

The possible end-point locations are:

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 Non-MSDN link 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 ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:

TextRange



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.