How to Use Mouse down and Mouse up events in JQuery

Mousedown Event:- How to Use Mouse down and Mouse up events in JQuery

The mousedown() method connect an event handler function to an HTML element.

The function is executed, when the left, middle or right mouse button is pressed down, while the mouse is over the HTML element:

Example

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#p12").mousedown(function(){
    alert("Mouse down p12!");
  });
});
</script>
</head>
<body>

<p id="p12">Mousedown Event</p>

</body>
</html>

Mouseup Event:-

The mouseup() method connect an event handler function to an HTML element.

The function is executed, when the left, middle or right mouse button is released, while the mouse is over the HTML element.

Example

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#p12").mouseup(function(){
    alert("Mouse up p12!");
  });
});
</script>
</head>
<body>

<p id="p12">Mouseup Event</p>

</body>
</html>

How to Use Mouse down and Mouse up events in JQueryexpoundsofttechsolution

What Is Beacon ?