In JavaScript, the pointerdown event fires when a pointer becomes active (MDN): mouse (first button pressed), touch (contact starts), or pen (stylus touches the digitizer).
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for pointerdown. Start with this line.
JavaScript
addEventListener("pointerdown", fn)
Call
What it does
addEventListener("pointerdown", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("pointerdown", …) — no import required.
Library declarations
JavaScript
addEventListener("pointerdown", fn)
Parameters
Parameter
Description
Event name
Required. "pointerdown"
Handler prop
Optional. onpointerdown
PointerEvent
Required. pointerId, pointerType, …
Capture
Optional. setPointerCapture for drag tracking
Return Value
Return Value
Description
*
Fires as an Element event (listener receives the Event object).
JavaScript Examples
Example 1 — Log pointerdown (MDN)
MDN’s basic listener when a pointer becomes active.
JavaScript
const para = document.querySelector("p");
para.addEventListener("pointerdown", (event) => {
console.log("Pointer down event", event.pointerId, event.pointerType);
});
MDN: it fires when a pointer becomes active — mouse when the first button is pressed, touch when contact starts, pen when the stylus touches the digitizer.
No. MDN marks Element pointerdown as Baseline Widely available (since July 2020). It is not Deprecated, Experimental, or Non-standard.
A PointerEvent. Useful fields include pointerId, pointerType, isPrimary, and pressure.
MDN: with a physical mouse, mousedown fires for every button press. pointerdown fires only for the first button; extra buttons held at the same time do not fire more pointerdown events.
MDN: on touchscreen browsers that allow direct manipulation, pointerdown can trigger implicit capture so later events target the same element until pointerup or pointercancel (or releasePointerCapture).
Prefer it to start unified mouse/touch/pen gestures and setPointerCapture. Keep primary activate actions on click for keyboard accessibility.