onmouseupEvent

事件对象参考手册Event Object

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):

  1. onmousedown
  2. onmouseup
  3. onclick

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

  1. onmousedown
  2. onmouseup
  3. 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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