Javascript examples for jQuery Method and Property:mousedown
trigger the mousedown event for the selected elements:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").mousedown(function(){ $("p").slideToggle(); });//from w w w . j av a2 s.c om $("div").mouseover(function(){ $("button").mousedown(); }); }); </script> </head> <body> <div>Mouse over this text to trigger the mousedown event for the button above.</div> <p>This is a paragraph.</p> <button>Toggle</button><br><br> </body> </html>