onmouseupEvent
Examples
Execute JavaScript code when the user releases the mouse button:
<p onmouseup="mouseUp()">Click the text!</p>
Try it Yourself »
Definition and Usage
The onmouseup event occurs when the mouse button is released.
Tip:The sequence of events related to the onmouseup event (left/middle mouse button):
- onmousedown
- onmouseup
- onclick
The sequence of events related to the onmouseup event (right mouse button):
- onmousedown
- onmouseup
- oncontextmenu
Syntax
In HTML:
<element
onmouseup="SomeJavaScriptCode">
In JavaScript:
object.onmouseup=function(){SomeJavaScriptCode};
| Parameter | Description |
|---|---|
| SomeJavaScriptCode | Required. Specifies the JavaScript to execute 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: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.
Event Object Other Extensions