Skip to content

Feat: Caret Position Web APIs #40527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
sideshowbarker authored Jul 25, 2025
commit c561ee48562e4378a2c540084065407d9a4a078f
4 changes: 2 additions & 2 deletions files/en-us/web/api/caretposition/offset/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ page-type: web-api-instance-property
browser-compat: api.CaretPosition.offset
---

The **`offset`** property of the {{domxref("CaretPosition")}} interface returns a `long` representing the offset of the selection in the caret position node.
The **`offset`** property of the {{domxref("CaretPosition")}} interface returns an integer representing the offset of the selection in the caret position node.

This will be the character offset in a text node or the selected child node's index in an element node.

## Value

A long.
An integer.

## Examples

Expand Down