Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

onmouseup event

onmouseup event

Event Object Reference Event Object

Example

Execute JavaScript code when the user releases the mouse button:

Click the text!

Try it »


Definition and Usage

The onmouseup event occurs when the mouse button is released.

**Tip:** The order of events associated with the onmouseup event (left/middle mouse button):

  1. onmousedown
  2. onmouseup
  3. onclick

The order of events associated with the onmouseup event (right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Syntax

In HTML:

<

element

onmouseup="

SomeJavaScriptCode

">

In JavaScript:

object

.onmouseup=function(){

SomeJavaScriptCode

};

Parameters Description
SomeJavaScriptCode Required. Specifies the JavaScript to be executed 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: , ,
, , ,