web api instance property
Selection: anchorOffset property
The Selection.anchorOffset read-only property returns the
number of characters that the selection’s anchor is offset within the
anchorNode if said node is of type Text, CDATASection or Comment.
In the case of anchorNode being another type of node, Selection.anchorOffset returns the number of childNodes the selection’s anchor is offset within the anchorNode.
This number is zero-based. If the selection begins with the first character in the
anchorNode, 0 is returned.
Value
A number.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
Selection, the interface it belongs to.