Αιτία onmouseup

Definition and usage

The onmouseup event occurs when the user releases the mouse button over an element.

Tip:Event sequence related to onmouseup event (for left mouse button/middle mouse button):

  1. onmousedown
  2. onmouseup
  3. onclick

Event sequence related to onmouseup event (for right mouse button):

  1. onmousedown
  2. onmouseup
  3. oncontextmenu

Example

Execute JavaScript when the mouse button is released over a paragraph:

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

Try it yourself

Syntax

In HTML:

<element onmouseup="myScript">

Try it yourself

In JavaScript:

object.onmouseup = function(){myScript};

Try it yourself

In JavaScript, use the addEventListener() method:

object.addEventListener("mouseup", myScript);

Try it yourself

Note:Internet Explorer 8 or earlier versions do not support addEventListener() method.

Technical details

Bubbling: Υποστήριξη
Cancellable: Υποστήριξη
Event types: MouseEvent
Supported HTML tags: All HTML elements except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style> and <title>
DOM version: Γεγονότα επίπεδο 2

Υποστήριξη προγράμματος περιήγησης

Γεγονότα Chrome IE Firefox Safari Opera
onmouseup Υποστήριξη Υποστήριξη Υποστήριξη Υποστήριξη Υποστήριξη