HTML onmouseup event attribute

Example

When the mouse button is released over a paragraph, execute JavaScript:

<p onmouseup="mouseUp()">Click the text!

Try It Yourself

Browser Support

IE Firefox Chrome Safari Opera

All major browsers support the onmouseup attribute.

Definition and Usage

The onmouseup attribute triggers when the mouse button is released.

Tip:Relative event order to onmouseup event (limited to left/right/middle mouse button):

  1. onmousedown
  2. onmouseup
  3. onclick

Event order of onmouseup event (limited to right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Note:The onmouseup attribute is not applicable to the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> or <title>.

Differences between HTML 4.01 and HTML5

None.

Syntax

<element onmouseup="script">

Attribute Value

Value Description
script Script executed when onmouseup occurs.