MDN self-hosted library · e01.org

PointerEvent: pointerId property

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
let id; // Let's assume that this is a previously saved pointerId

target.addEventListener("pointerdown", (event) => {
  // Compare previous event's ID that was cached
  // to current event's ID and handle accordingly
  if (id === event.pointerId) process_event(event);
});