jQuery Trigger Mouseup Event Method

jQuery trigger Mouseup event; Through this tutorial; i am going to show you what is mouseup event method in jQuery and how to use mouseup event with html elements.

jQuery Trigger Mouseup Event

The jQuery mouseup event occurs when the mouse button is released on selected HTML elements. Learn by example mouseup event.

Syntax jQuery Trigger Mouseup Event

$(selector).mouseup()  

This triggers the jQuery mouseup event for selected elements.

$(selector).mouseup(function)  

Parameters of jQuery Trigger Mouseup Event

  • Function :- This is an optional parameter. This work when the mouseup event is triggered.

Example 1 – jQuery Trigger Mouseup Event

See the example 1 of jQuery Trigger Mouseup Event; as shown below:

<html>    
<head>    
<title>jQuery Mouse Up Event</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>     
<script>    
$(document).ready(function(){    
    $("#first").mouseup(function(){    
       $( "span" ).text( "Mouseup event triggered" ).show().fadeOut( 3000 );   
    });    
});    
</script>    
</head>    
<body>    
<h5 id="first"> Button press and release</h5>   
<span></span>   
</body>    
</html>  

Example 2 – jQuery Trigger Mouseup Event

See the example 2 of jQuery Trigger Mouseup Event; as shown below:

<!DOCTYPE html>
<html>
<head>
<title>jQuery Mouse Up Event</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script> 
$(document).ready(function(){
	$("#second").mouseup(function(){
	    $( this ).text("Mouse Up Triggered");
	  });
	});
</script>
</head>
<body>
<div id="second">Click Here for Preview</div>
</body>
</html>

Recommended jQuery Tutorials

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *