W3cubDocs

/Web APIs

AbstractRange: startOffset property

The read-only startOffset property of the AbstractRange interface returns the offset into the start node of the range's start position.

Value

An integer value indicating the number of characters into the Node indicated by startContainer at which the first character of the range is located.

Example

js

let startOffset = range.startOffset;

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
startOffset 90 9018–79 69 No 76 14.1 90 90 79 64 14.5 15.0

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AbstractRange/startOffset