THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML onmouseup Event Attribute

❮ HTML Event Attributes

Example

Execute a JavaScript when releasing a mouse button over a paragraph:

<p onmouseup="mouseUp()">Click the text!</p>
Try it Yourself »

Definition and Usage

The onmouseup attribute fires when a mouse button is released over the element.

Tip: The order of events related to the onmouseup event (for the left/middle mouse button):

  1. onmousedown
  2. onmouseup
  3. onclick

The order of events related to the onmouseup event (for the right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Browser Support

Event Attribute
onmouseup Yes Yes Yes Yes Yes

Differences Between HTML 4.01 and HTML5

None.


Syntax

<element onmouseup="script">

Attribute Values

Value Description
script The script to be run on onmouseup

Technical Details

Supported HTML tags: All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>

Related Pages

HTML DOM reference: onmouseup event


❮ HTML Event Attributes