Javascript examples for jQuery Method and Property:mousedown
Run function when the left, middle or right mouse button is pressed down over the HTML element
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#p1").mousedown(function(){ console.log("Mouse down over p1!"); });//from ww w .j a v a2 s .c o m }); </script> </head> <body> <p id="p1">This is a paragraph.</p> </body> </html>