Element: mouseup event

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The mouseup event is fired at an Element when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is located inside it.

mouseup events are the counterpoint to mousedown events.

This behavior is different from pointerup events. When using a physical mouse, mouseup events fire whenever any button on a mouse is released. pointerup events fire only upon the last button release; previous button releases, while other buttons are held down, don't fire pointerup events.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("mouseup", (event) => { })

onmouseup = (event) => { }

Event type

A MouseEvent. Inherits from UIEvent and Event.

Event UIEvent MouseEvent

Examples

See mousemove event for example code.

Specifications

Specification
Pointer Events
# mouseup
HTML
# handler-onmouseup

Browser compatibility

See also