The mouseup event fires when a pointing-device button is released inside an element. Learn addEventListener vs onmouseup, button / buttons, how it differs from mousedown, click, and pointerup, drag-end patterns, and five try-it labs.
01
Kind
Instance event
02
Type
MouseEvent
03
When
Button released
04
Handler
onmouseup
05
Pair
mousedown
06
Status
Baseline widely available
Fundamentals
Introduction
mouseup answers: “Did the user just release a pointing-device button while the pointer was over this element?” It is the counterpoint to mousedown.
A completed left-click usually runs mousedown → mouseup → click. Use mouseup to end a press, finish a drag, or clear pressed styles. Prefer click for primary UI actions so keyboard users are included.
💡
Beginner tip
With a physical mouse, mouseup fires whenever any button is released. pointerup fires only for the last button release while others were still held.
Concept
Understanding mouseup
An instance event that answers: “Was a pointing-device button just released here?”
Fires when a button is released while the pointer is inside the element.
mouseup is marked Baseline Widely available on MDN (since July 2015). Logos use the shared browser-image-sprite.png sprite from this project. MouseEvent button/buttons and coordinates are supported across modern engines.
✓ Baseline · Widely available
Element mouseup
Fires when a pointing-device button is released; pair with mousedown 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 ExplorerSupported (legacy MouseEvent)
Yes
mouseupBaseline
Bottom line: Safe for release / drag-end UX. Keep primary activate actions on click for accessibility.
Wrap Up
Conclusion
mouseup is the immediate “button released” signal. Use it to end presses and drags, pair it with mousedown, and keep primary activation on click.
Use mouseup to end press feedback and drag sessions
Check event.button when non-primary releases matter
Listen on window when release may happen outside the start target
Prefer click for primary activate actions
Prefer addEventListener in production code
❌ Don’t
Replace click with mouseup for primary buttons/links
Assume every press will also produce a click on the same element
Assume mouseup equals pointerup for multi-button mice
Forget to clear pressed UI if release happens outside the element
Overwrite onmouseup if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about mouseup
Button released now—use click for full activation.
5
Core concepts
📱01
On release
fires immediately
Trigger
📄02
MouseEvent
button · coords
API
👆03
vs click
release ≠ activate
Compare
🔄04
mousedown
press pair
Pair
🎯05
Baseline
widely available
Status
❓ Frequently Asked Questions
It fires when a pointing-device button is released while the pointer is inside the element. It is the counterpoint to mousedown.
No. MDN marks Element mouseup as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
A MouseEvent (inherits from UIEvent and Event). Useful fields include button, buttons, clientX, clientY, and modifier keys such as ctrlKey and shiftKey.
mouseup fires when the button goes up. click fires after a completed press-and-release activation (typically after mousedown and mouseup). Prefer click for primary UI actions so keyboard users are included.
With a physical mouse, mouseup fires whenever any button is released. pointerup fires only for the last button release; earlier releases while other buttons remain held do not fire pointerup.
Use it to end a press, finish a drag, clear pressed styles, or react to a specific button release. Keep primary activate-on-click actions on click.
Did you know?
Holding two mouse buttons and releasing them one by one can produce two mouseup events, but only one pointerup (when the last button goes up). That difference is called out on MDN’s mouseup page.