isEqual method (TextRange)
You can also use the compareEndPoints and inRange methods to compare the placement of two TextRange objects in Internet Explorer.
You can find the related objects in the Supported by objects section below.
|Required. Reference to a TextRange object to compare.|
Boolean. One of the following values:
|The two TextRange objects are not identical.|
|The two TextRange objects are identical.|
Example HTML code 1:
This example works around a bug of the isEqual method. If a range is created from the current selection where the selected content is the text content of an element and another range is aligned to the text content of this element, then the isEqual method returns false for these two ranges. Conclusion: use the compareEndPoints method for TextRange comparison.
Did you find this example helpful?
User Contributed Comments