onmouseup event
Example
Execute JavaScript code when the user releases the mouse button:
Click the text!
Try it »
Definition and Usage
The onmouseup event occurs when the mouse button is released.
**Tip:** The order of events associated with the onmouseup event (left/middle mouse button):
- onmousedown
- onmouseup
- onclick
The order of events associated with the onmouseup event (right mouse button):
- onmousedown
- onmouseup
- oncontextmenu
Syntax
In HTML:
<
element
onmouseup="
SomeJavaScriptCode
">In JavaScript:
object
.onmouseup=function(){
SomeJavaScriptCode
};
| Parameters | Description |
|---|---|
| SomeJavaScriptCode | Required. Specifies the JavaScript to be executed when the event occurs. |
Browser support





All major browsers support the onmouseup event
HTML tags that support this event:
The onmouseup attribute can be used on all HTML elements, except:
, , ,
Event Object