mousedown is sent when the mouse button is pressed while the pointer is over an element — before release. Bind it with .on("mousedown", handler) (jQuery 1.7+).
Remember
$("#target").on("mousedown", function () { ... })
$("#target").trigger("mousedown")
// Fires on press (any button)
// Prefer on/trigger — not the deprecated .mousedown()
// Left button: event.which === 1
Select an element, bind with .on, optionally check event.which.
Select the element(s): $("#box"), $("p"), etc.
Bind: .on("mousedown", function (event) { ... }).
Optional: gate on event.which === 1 for the left button.
To fire in code: .trigger("mousedown"). Unbind with .off("mousedown").
Piece
Required?
Role
"mousedown"
Yes
Event type string for .on / .trigger
handler
Yes (bind)
Runs on each button press
eventData
Optional
Extra data passed into the handler
Return value
—
jQuery set (chainable)
Pseudocode
Pseudocode
function onMousedown(element, handler):
when pointer is over element
and any mouse button is pressed:
handler(event) // event.which = 1|2|3
trigger(element, "mousedown"):
run all mousedown handlers on element
Reference
Cheat Sheet
Keep these facts handy while wiring press handlers.
Topic
Detail
Bind
.on("mousedown", handler) (1.7+)
Trigger
.trigger("mousedown") (1.0+)
When
Button pressed over the element
event.which
1 left · 2 middle · 3 right
vs click
Press only — no release required
Unbind
.off("mousedown")
Deprecated
.mousedown() shorthand (3.3+)
Try it
Live Preview
Run presets that use .on("mousedown") and .trigger("mousedown").
Uses .on("mousedown") and .trigger("mousedown") — same ideas as the examples below.
Result
Handler for mousedown called.
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console, or use Try It Yourself for a live editor.
Example 1 — Bind a mousedown Handler
Official style: .on("mousedown", …) on a target element.
jQuery
$("#target").on("mousedown", function () {
console.log("Handler for mousedown called.");
});
Fire the same handlers with a single click on another control.
jQuery
$("#target").on("mousedown", function () {
console.log("Handler for mousedown called.");
});
$("#other").on("click", function () {
$("#target").trigger("mousedown");
});
Press mouse and release here. Mouse down. Mouse up.
How It Works
mousedown appends text on press.
mouseup appends text on release.
Order is always down then up for a normal press.
Chain both with .on on the same set.
Example 5 — Event Delegation
One parent handler covers current and future children.
jQuery
$("#list").on("mousedown", "li", function () {
console.log("Press: " + $(this).text());
});
// Later…
$("#list").append("<li>New item</li>");
// New item works too — no extra bind
Deprecated in 3.3. Use .on("mousedown") / .trigger("mousedown") / .off("mousedown").
vs click
Press-away cancels click, not mousedown
Press inside then release outside still counts as mousedown. Prefer click for finished actions.
which
Gate drags on which === 1
Ignoring middle/right presses avoids fighting with scroll-click and context menus.
right
Right-click is unreliable via which
Some browsers do not expose right button mousedown clearly. Use contextmenu for menus.
dynamic
New DOM nodes need delegation
Prefer .on("mousedown", "child", fn) on a stable parent for lists and boards.
Compatibility
Browser Support
The native mousedown event works in all browsers. Bind with .on("mousedown") since jQuery 1.7; .trigger("mousedown") since 1.0. Prefer these over the deprecated .mousedown() shorthand (3.3+).
✓ jQuery 1.7+ (.on)
mousedown event
Supported everywhere jQuery event APIs run in the browser. Use on/trigger for modern code.
100%Browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
on("mousedown")Excellent
Bottom line: Bind with .on("mousedown", fn). Check event.which for the primary button. Prefer click when you need a full press-and-release.
Analysis
Performance Notes
Approach
Cost
Best for
Direct .on("mousedown")
1 handler / element
Few static controls
Delegated .on
1 handler / parent
Lists / canvases / dynamic UI
Heavy work on every press
Can feel laggy
Keep handlers light; defer work
Delegation scales better than binding hundreds of individual press handlers. Always .off when removing long-lived widgets to avoid leaks.
Remember
Key Takeaways
Bind:.on("mousedown", handler) — not deprecated .mousedown().
Timing: fires on press — before release.
Buttons: use event.which (1 left / 2 middle / 3 right).
Prefer click for finished actions; mousedown for press / drag-start.
One line: use .on("mousedown", fn) for immediate press handling — check event.which when the button matters.
Frequently Asked Questions
mousedown fires when the mouse button is pressed while the pointer is over an element — before release. Bind with .on("mousedown", handler) (jQuery 1.7+). Any HTML element can receive it.
Prefer .on("mousedown", handler). The .mousedown(handler) shorthand is deprecated since jQuery 3.3. To fire the event, use .trigger("mousedown") instead of .mousedown().
mousedown fires on press. click needs press and release inside the same element. If the user presses inside then releases outside, mousedown still fired but click does not.
jQuery normalizes event.which: 1 = left, 2 = middle, 3 = right. Use which === 1 to start drags only on the primary button so right-click context menus are not disrupted.
Call $(selector).trigger("mousedown"). That runs bound handlers. Use .triggerHandler("mousedown") to run handlers without default browser behavior.
event.which === 3 means right button, but it is not fully reliable in every browser. Prefer the contextmenu event for custom right-click menus.