jQuery mouseup()Method

jQuery 事件方法jQuery Event Methods

Example

Release the left mouse button on the <div> element to insert some text:

$("div").mouseup(function(){
$(this).after("Release mouse button.");
});

Try it yourself »

Definition and Usage

When the mouse pointer moves over an element and the left mouse button is released, the mouseup event occurs.

The mouseup() method triggers the mouseup event, or attaches a function to run when the mouseup event occurs.

Tip:This method is usually used together with themousedown()method.


Syntax

Trigger the mouseup event for the selected elements:

$(selector).mouseup() Try it yourself

Add a function to the mouseup event:

$(selector).mouseup(function) Try it yourself

Parameters Description
function Optional. Specifies a function to run when the mouseup event is triggered.


jQuery 事件方法jQuery Event Methods

Other Extensions