HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery mousedown() Method

jQuery Event Methods jQuery Event Methods

Example

Press down the left mouse button over a <div> element to insert some text:

$("div").mousedown(function(){
  $(this).after("Mouse button pressed down.");
});

Try it yourself »

Definition and Usage

The mousedown event occurs when the left mouse button is pressed down over the selected element.

The mousedown() method triggers the mousedown event, or attaches a function to run when a mousedown event occurs.

Tip: This method is often used together with the mouseup() method.


Syntax

Trigger the mousedown event for the selected elements:

$(selector).mousedown() Try it

Attach a function to the mousedown event:

$(selector).mousedown(function) Try it

Parameter Description
function Optional. Specifies the function to run when the mousedown event is triggered


jQuery Event Methods jQuery Event Methods


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE