jQuery - .click(), .dblclick(), .mousedown(), and .mouseup() work in jQuery:
User Action: Press and release mouse button
Quick Reference Table
| Event | When it fires | Use case |
|---|---|---|
mousedown |
Pressing mouse button down | Drag start, drawing, game controls |
mouseup |
Releasing mouse button | Drag end, drawing, game controls |
click |
Press + release (single click) | Buttons, links, normal click actions |
dblclick |
Two quick clicks in succession | Special actions, editing, toggles |
Tip:
-
.click()and.dblclick()can be used together, but be careful: sometimes a double-click also triggers a single-click handler first. -
.mousedown()and.mouseup()give more granular control over mouse actions.