The dblclick event fires when a pointing device double-clicks an element. Learn addEventListener vs ondblclick, order vs click, MouseEvent coordinates, UX tips, and five try-it labs.
01
Kind
Instance event
02
Type
MouseEvent
03
After
Two click events
04
Handler
ondblclick
05
Useful fields
clientX / clientY
06
Status
Baseline widely available
Fundamentals
Introduction
A double-click is two rapid primary-button clicks on the same element. Desktop apps often use it for shortcuts: rename a file, zoom a map, expand a card, or open an item.
In the DOM, dblclick arrives after two click events have already fired. That means a double-click also runs any click listeners twice unless you design carefully.
💡
Beginner tip
Keep primary actions on click. Use dblclick for optional power features, and offer a visible button or menu item for the same result.
Concept
Understanding dblclick
An instance event that answers: “Was this element double-clicked with a pointing device?”
Fires on a rapid double primary-button click.
Order — after two click events (each after mousedown + mouseup).
MouseEvent — coordinates, button, modifier keys.
Handler — ondblclick or addEventListener("dblclick", ...).
Baseline Widely available on MDN (since July 2015).
Foundation
📝 Syntax
Use the event name with addEventListener, or set the handler property:
Which mouse button was used (primary is usually 0)
ctrlKey / shiftKey / altKey / metaKey
Modifier keys held during the event
Sequence
🔁 Event Order
mousedown → mouseup → click (first click)
mousedown → mouseup → click (second click)
dblclick
If both click and dblclick handlers change the same UI, the first click may run before your double-click intent is clear. Prefer separate targets or delayed single-click logic only when you truly need it.
dblclick is marked Baseline Widely available on MDN (since July 2015). Logos use the shared browser-image-sprite.png sprite from this project. Double-tap timing on touch devices still varies.
✓ Baseline · Widely available
Element dblclick
Works across modern desktop browsers for mouse double-clicks; offer alternatives on touch.
100%Widely available
Google ChromeSupported · Desktop & Android
Full support
Mozilla FirefoxSupported · Desktop & Android
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
OperaSupported · Modern versions
Full support
Internet ExplorerSupported (legacy)
Supported
dblclickBaseline
Bottom line: Use dblclick for optional desktop shortcuts after two clicks; keep primary actions on click.
Wrap Up
Conclusion
dblclick is the “user double-clicked” signal. It arrives after two click events—great for optional shortcuts, not as the only way to do a critical action.
Overwrite ondblclick if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about dblclick
Two rapid clicks—after click×2; use for shortcuts, not sole primary actions.
5
Core concepts
🖱️01
Double-click
rapid ×2
Trigger
📄02
MouseEvent
coords + keys
API
🔁03
After click×2
then dblclick
Order
⚡04
Shortcut UX
not only path
Pattern
🎯05
Baseline
widely available
Compat
❓ Frequently Asked Questions
It fires when a pointing-device primary button is double-clicked on an element — two rapid clicks within a short time span.
No. MDN marks Element dblclick as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
A MouseEvent (inherits from UIEvent and Event). Useful fields include clientX, clientY, button, and modifier keys.
dblclick fires after two click events (and therefore after two pairs of mousedown and mouseup).
Usually no. Prefer click for main actions so touch and keyboard users are included. Use dblclick for optional shortcuts such as rename, zoom, or expand.
Double-tap behavior varies by device and browser. Always provide a single-tap or button alternative for the same action.
Did you know?
MDN’s card demo toggles a large CSS class on double-click and uses user-select: none so the browser does not highlight the card text while you practice double-clicking.