jQuery Event - mouseup() Method

Example

Hide or show the element when the mouse button is released:

$("button").mouseup(function() {
  $("p").slideToggle();
});

Try It Yourself

Definition and Usage

The mouseup event occurs when the mouse button is released over the element.

Unlike the click event, the mouseup event only requires the button to be released. The event is triggered when the mouse pointer is over the element and the mouse button is released.

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

Triggers the mouseup event

Syntax

$(selector).mouseup()

Try It Yourself

Binds a function to the mouseup event

Syntax

$(selector).mouseup(function)
Parameters Description
function Optional. Specifies the function to be executed when the mouseup event occurs.

Try It Yourself