.mouseup()
methodThe .mouseup()
method in jQuery is used to bind an event handler to the mouseup
event on the elements, or trigger that event on an element.
When the mouse pointer is over the element and any mouse button is released, the event mouseup
is fired.
.mouseup()
method Syntax.mouseup() .mouseup(handler) .mouseup(eventData,handler)
.mouseup(handler)
and .mouseup(eventData,handler)
are shortcut for .on( "mouseup", handler )
.mouseup()
is shortcut for .trigger( "mouseup" )
Parameter | Type | Description |
---|---|---|
handler |
Function | A function to execute when the mouseup is triggered on the matched element. |
eventData |
Anything | Additional data passed to the event handler. |
.mouseup()
method ExampleTrigger the mouseup event on target:
HTML
<div id="target">target</div> <div id="btn"> Trigger mouseup event on target </div>
jQuery
$( "#target" ).mouseup(function() { console.log( "mouseup." ); }); $("#btn").click(function(){ $( "#target" ).mouseup(); }
.mouseup([eventData,]handler)
method ExampleFollowing is a simple example that how texts when mouseup event triggering.
$("p").mouseup( function () { $(this).hide(); });