English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery mouseup() method

jQuery Events

The mouseup() method triggers a mouseup event, or attach a function to be executed when a mouseup event occurs.

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

The mouseup() method is usually used withmousedown()Methods used together.

Syntax:

Trigger the mouseup event of the selected element:

$(selector).mouseup()

Attach function to the mouseup event:

$(selector).mouseup(function)

Example

Display text when the mousedown and mouseup events are triggered:

$("p").mousedown(function(){
  $(this).after("<p style="39;color:red;'Mouse pressed</p>
});
$("p").mouseup(function(){
  $(this).after("<p style="39;color:green;'Mouse released</p>
});
Test and see‹/›

Parameter Value

ParameterDescription
functionFunction executed each time the mouseup event is triggered

jQuery Events