The pointerup event fires when a pointer is no longer active. Learn addEventListener vs onpointerup, how it differs from mouseup, why you must also handle pointercancel, ending drag after setPointerCapture, and five try-it labs.
01
Kind
Instance event
02
Type
PointerEvent
03
When
Pointer no longer active
04
Handler
onpointerup
05
Alt end
pointercancel
06
Status
Baseline widely available
Fundamentals
Introduction
pointerup answers: “Did this pointer just become inactive?” That covers mouse (last button released), touch (finger up), and pen (stylus lift) under one API.
Pair it with pointerdown to start/end gestures. MDN also reminds you that a gesture can end with pointercancel instead—clear state on both paths.
💡
Beginner tip
With a physical mouse, mouseup fires for every button release. pointerup fires only for the last button; releasing earlier buttons while others stay held does not fire pointerup.
Concept
Understanding pointerup
An instance event that answers: “Did this pointer just go inactive?”
Mouse — last held button released (not each earlier release).
Touch — contact ends (finger lifts).
Pen — stylus lifts from the digitizer.
Alt end — pointercancel may replace a normal up.
Baseline Widely available on MDN (since July 2020).
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
A PointerEvent (inherits from MouseEvent and Event).
Handy properties
Property
Meaning
pointerId
Unique id for this pointer stream
pointerType
mouse, pen, touch, etc.
isPrimary
Whether this is the primary pointer of that type
clientX / clientY
Pointer position in the viewport
buttons
Bitmask of buttons still pressed (often 0 after last release)
Compare
⚖️ pointerup vs Related Events
Event
Typical use
pointerup
Pointer became inactive (last mouse button / lift)
mouseup
Every mouse button release (mouse-only legacy path)
pointerdown
Pointer became active (first button / contact)
pointercancel
Browser aborted the pointer; clear gesture state
click
Full activation; prefer for primary buttons/links
Important path
🚫 Always Pair with pointercancel
MDN: remember it is possible to get pointercancel instead of pointerup. Mobile browsers, stylus interruptions, and system gestures can abort a pointer mid-drag.
Share one endGesture() function for both up and cancel.
Release capture / CSS pressed states in that shared cleanup.
Do not assume every pointerdown gets a matching pointerup.
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Listen
el.addEventListener("pointerup", fn)
Handler property
el.onpointerup = fn
Identify pointer
event.pointerId, event.pointerType
End drag
Clear state on pointerup and pointercancel
vs mouseup
Last button only for mouse
MDN status
Baseline Widely available (Jul 2020)
Snapshot
🔍 At a Glance
Four facts to remember about pointerup.
Event type
PointerEvent
MouseEvent + more
Means
inactive now
Normal release
vs mouseup
last button
Not every release
Baseline
yes
Since Jul 2020
Hands-On
Examples Gallery
Examples follow MDN Element: pointerup event. Press and release with a mouse, touch, or pen on the stage elements.
📚 Getting Started
MDN listener patterns and the handler property.
Example 1 — Log pointerup (MDN)
Fire when the pointer becomes inactive on the paragraph.
JavaScript
const para = document.querySelector("p");
const out = document.getElementById("out");
para.addEventListener("pointerup", (event) => {
out.textContent = "Pointer up";
});
pointerup is marked Baseline Widely available on MDN (since July 2020). Logos use the shared browser-image-sprite.png sprite from this project. Pointer Events unify mouse, touch, and pen across modern engines.
✓ Baseline · Widely available
Element pointerup
Fires when a pointer is no longer active; pair with pointercancel and prefer click for primary actions.
FullWidely available
Google ChromeFull support
Yes
Mozilla FirefoxFull support
Yes
Apple SafariFull support
Yes
Microsoft EdgeFull support
Yes
OperaFull support
Yes
Internet ExplorerPointer Events (legacy IE11 path)
Partial
pointerupBaseline
Bottom line: Use pointerup to end unified gestures. Remember the last-button difference vs mouseup on multi-button mice.
Wrap Up
Conclusion
pointerup is the unified “pointer became inactive” signal. Use it to finish gestures started with pointerdown—and always clear state on pointercancel too.
Prefer pointerup to end unified mouse/touch/pen gestures
Clear state on both pointerup and pointercancel
Key multi-touch cleanup by pointerId
End capture/drag sessions on release
Prefer click for primary activate actions
❌ Don’t
Assume pointerup equals mouseup for multi-button mice
Forget the cancel path on mobile / stylus devices
Replace click with pointerup for primary buttons/links
Leave pressed CSS classes if cancel fires instead of up
Overwrite onpointerup if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about pointerup
Pointer became inactive—one API for mouse, touch, and pen release.
5
Core concepts
📱01
On release
pointer inactive
Trigger
📄02
PointerEvent
id · type · coords
API
👆03
vs mouseup
last button only
Compare
🚫04
Also cancel
clear both paths
Pattern
🎯05
Baseline
since Jul 2020
Status
❓ Frequently Asked Questions
It fires when a pointer is no longer active—for example when a mouse’s last held button is released, a finger lifts, or a stylus lifts from the digitizer.
No. MDN marks Element pointerup as Baseline Widely available (since July 2020). It is not Deprecated, Experimental, or Non-standard.
A PointerEvent (inherits from MouseEvent and Event). Useful fields include pointerId, pointerType, isPrimary, clientX, and clientY.
With a physical mouse, mouseup fires whenever any button is released. pointerup fires only on the last button release; releasing earlier buttons while others stay held does not fire pointerup.
Yes. MDN notes it is possible to get pointercancel instead of a normal pointerup—for example when the browser aborts the gesture. Always clear state on both paths.
Use it to end unified mouse/touch/pen gestures started with pointerdown (drag release, ink lift). Keep primary activate actions on click for keyboard accessibility.
Did you know?
Holding left and right mouse buttons, then releasing them one at a time, can produce two mouseup events but only one pointerup (the final release). That mirrors the first-button rule for pointerdown.