rangeOffset property (event)
Returns the end position of the current selection relative to the element referred to by the rangeParent.
The rangeParent and rangeOffset properties together specify the end position of the selection. The use of them is not recommended.
A more useful solution is to create a selectionRange object from the current selection with the getSelection method. The selectionRange object is widely supported and provides various information about the current selection.For example the focusNode and focusOffset properties together specify the end position of the selection. The example below illustrates it.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Integer that retrieves the end position.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the focusOffset property instead of the rangeOffset property:
Did you find this example helpful?
User Contributed Comments