Selection: focusOffset property

The Selection.focusOffset read-only property returns the number of characters that the selection's focus is offset within the Selection.focusNode.

This number is zero-based. If the selection ends with the first character in the Selection.focusNode, 0 is returned.

Value

A number.

Specifications

Specification
Selection API
# dom-selection-focusoffset

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
focusOffset

See also