.mousedown() is a shorthand for binding or triggering the mousedown event (button press). With a handler it binds; with no arguments it triggers. Prefer .on / .trigger in new code.
Optional data (1.4.3+): .mousedown({ key: "v" }, handler) → event.data.
Trigger (legacy): .mousedown() with no args — or use .trigger("mousedown").
Piece
Required?
Role
handler
For bind
Runs on mouse button press
eventData
Optional
Available as event.data
No args
—
Triggers mousedown on the set
Return value
—
jQuery set (chainable)
Pseudocode
Pseudocode
function mousedown(element, handler?):
if handler given:
bind "mousedown" → handler // like .on("mousedown", handler)
else:
trigger "mousedown" // like .trigger("mousedown")
// Prefer naming the event explicitly with on / trigger
Reference
Cheat Sheet
Quick map from shorthand to modern calls.
Legacy
Modern
.mousedown(fn)
.on("mousedown", fn)
.mousedown(data, fn)
.on("mousedown", data, fn)
.mousedown()
.trigger("mousedown")
Unbind
.off("mousedown")
Added
1.0 (data form 1.4.3)
Status
Deprecated 3.3+
Try it
Live Preview
Run presets that show bind, eventData, and no-arg trigger via .mousedown().
Legacy demos for reading old code — prefer .on / .trigger in new projects.
Result
Handler ran via .mousedown(fn).
Code
jQuery Examples
Short snippets for legacy .mousedown(). Prefer the modern forms in new work — use Try It Yourself to experiment.
Example 1 — Bind with .mousedown(handler)
Deprecated shorthand for .on("mousedown", handler).
jQuery
$("#target").mousedown(function () {
console.log("Handler ran via .mousedown(fn).");
});
.mousedown() with no arguments fires the event — prefer .trigger("mousedown").
jQuery
$("#target").mousedown(function () {
console.log("Handler for mousedown called.");
});
$("#fire").click(function () {
$("#target").mousedown(); // same idea as .trigger("mousedown")
});
.mousedown(fn) is a thin wrapper around .on("mousedown", fn).
.on supports delegation and is not deprecated.
New projects should only use .on / .trigger / .off.
Edge Cases & Pitfalls
Common traps when reading or writing .mousedown() code.
deprecated
Do not use in new code
Binding forms are deprecated since 3.3. Teach and write .on("mousedown") instead.
vs-click
Press ≠ click
mousedown fires on press; click needs press + release. Prefer click for most buttons.
overload
Bind vs trigger looks similar
.mousedown(fn) binds; .mousedown() triggers. Check the arguments before assuming.
delegation
No child-selector form
.mousedown() cannot do .on("mousedown", "li", fn). For dynamic lists, use .on with a selector.
Compatibility
Browser Support
.mousedown() has existed since jQuery 1.0 (eventData since 1.4.3). It still runs in jQuery 3.x browsers, but is deprecated since 3.3 — prefer .on("mousedown") / .trigger("mousedown").
✓ Deprecated 3.3+
.mousedown() shorthand
Works wherever jQuery event APIs work in the browser. Use on/trigger for new code.
Switching to .on / .trigger does not slow you down — it clarifies intent and unlocks delegation.
Remember
Key Takeaways
Deprecated:.mousedown(handler) since jQuery 3.3.
Bind: use .on("mousedown", fn) instead.
Fire: use .trigger("mousedown"), not bare .mousedown().
Timing: press event — often for drag start, not normal clicks.
One line:.mousedown() is a deprecated shorthand — prefer .on("mousedown") and .trigger("mousedown").
Frequently Asked Questions
With a handler — .mousedown(handler) or .mousedown(eventData, handler) — it binds a callback that runs when a mouse button is pressed over the element. With no arguments — .mousedown() — it triggers mousedown on each matched element. Binding forms are deprecated since jQuery 3.3.
Yes. Prefer .on("mousedown", handler) or .on("mousedown", eventData, handler) to bind, and .trigger("mousedown") to fire. jQuery 3.x still runs .mousedown() for compatibility.
.mousedown(handler) only registers a callback. .mousedown() with no arguments triggers the event (same idea as .trigger("mousedown")).
Replace .mousedown(fn) with .on("mousedown", fn). Replace .mousedown(data, fn) with .on("mousedown", data, fn). Replace no-arg .mousedown() with .trigger("mousedown").
mousedown fires when the button is pressed (before release). click fires after a press-and-release on the same element. Prefer click for most UI actions; use mousedown when you need press-start behavior (for example, starting a drag).
Since 1.4.3 you can pass data before the handler. It appears as event.data inside the callback. Modern form: .on("mousedown", eventData, handler).