Sets the endpoint of one range based on the endpoint of another range.
Method of dom/TextRangedom/TextRange
Syntaxvar result = textRange.setEndPoint();
Parameters how
String that specifies the endpoint to transfer using one of the following values.
StartToEnd
Move the start of the TextRange object to the end of the specified SourceRange parameter.
StartToStart
Move the start of the TextRange object to the start of the specified SourceRange parameter.
EndToStart
Move the end of the TextRange object to the start of the specified SourceRange parameter.
EndToEnd
Move the end of the TextRange object to the end of the specified SourceRange parameter.
SourceRangeTextRange object from which the source endpoint is to be taken.
Return ValueReturns an object of type
ExamplesThe following example shows how to use the setEndPoint method to set the start point of the current range (r1
) to the endpoint of the second range (r2
).
<script type="text/javascript">
r1.setEndPoint("StartToEnd", r2);
</script>
Notes Syntax
var retval = TextRange.setEndPoint(how, SourceRange);
RemarksA text range has two endpoints: one at the beginning of the text range and one at the end. An endpoint can also be the position between two characters in an HTML document. There are four possible endpoint locations in the following HTML.
<BODY><P><B>abc
The possible endpoint locations are:
This feature might not be available on platforms other than Microsoft Win32. In Microsoft Internet Explorer 4.0, an endpoint is relative to text only, not HTML tags. In Internet Explorer 4.0, an endpoint cannot be established between body and p. Specifying an endpoint between body and p is interpreted as if it occurs before the letter a.
AttributionsMicrosoft Developer Network: [setEndPoint Method Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4