HTML onmouseupEvent Attribute

HTML 事件属性HTML Event Attributes

Examples

Run the script when the mouse button is released:

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onmouseup event attribute.


Definition and Usage

The onmouseup attribute is triggered when the user releases a mouse button.

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

  1. onmousedown
  2. onmouseup
  3. onclick

Order of events related to the onmouseup event (right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Note:The onmouseup attribute cannot be used on 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 Values

Value Description
script Specifies the script to be executed when the onmouseup event is triggered.


HTML 事件属性HTML Event Attributes Other Extensions