Skip to content
Merged
Changes from all commits
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
14 changes: 9 additions & 5 deletions files/en-us/web/api/pointerevent/pointerid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ browser-compat: api.PointerEvent.pointerId

{{ APIRef("Pointer Events") }}

The **`pointerId`** read-only property of the
{{domxref("PointerEvent")}} interface is an identifier assigned to a given pointer
event. The identifier is unique, being different from the identifiers of all other
active pointer events. Since the value may be randomly generated, it is not guaranteed
to convey any particular meaning.
The **`pointerId`** read-only property of the {{domxref("PointerEvent")}} interface
is an identifier assigned to the pointer that triggered the event. The identifier
is unique, being different from the identifiers of all other active pointer events.

A value `-1` indicates that the PointerEvent was not generated by a pointing device.
(For example, a {{domxref("Element/click_event", "click")}} event fired on a button
activated via keyboard.) Otherwise, the value may be randomly generated and should
not be relied on to convey any specific information about the device. The value is
only guaranteed to be stable for the lifetime of the page or session.

> [!NOTE]
> The `pointerId` property is implemented inconsistently across browsers and does not always persist for each ink stroke or interaction with the screen. For a reliable way of identifying multiple pointing devices on a screen simultaneously, see {{domxref("PointerEvent.persistentDeviceId")}}.
Expand Down