asp.net.ph

Skip Navigation Links

setEndPoint Method

DHTML Methods


DOM Level 2 Specification.

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

Syntax

textRange.setEndPoint ( sType, oTextRange ) 
Parameters

sType Required. String that describes the end point to transfer. This can be one of these 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 specifying the range from which the source end point is to be taken.

Return Value

No return value.

Remarks

A text range possesses two end points. One end point is located at the beginning of the text range, while the other is located at the end of the text range. An end point can also be characterized as the position between two characters in an HTML document.

In Microsoft® Internet Explorer® 4.0, an end point is relative to text only, not to HTML tags.

There are four possible end point locations in the following HTML:

<body><p><b>abc

The possible end point locations are:

  • Before the 'a'
  • Between the 'a' and the 'b'
  • Between the 'b' and the 'c'
  • After the '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 before the 'a'.

This method might not be available on non-Win32® platforms. See the Microsoft® Knowledge Base for the latest information on Internet Explorer® cross-platform compatibility.

Example

The following JScript™ ( compatible with ECMA-262 language specification ) example sets the start point of the current range ( r1 ) to the end point of the second range ( r2 ).

r1.setEndPoint ( "StartToEnd", r2 );
Applies To

TextRange



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note