In JavaScript, the dblclick event fires when a pointing-device button (such as a mouse’s primary button) is double-clicked on an element — two rapid clicks within a short time span (MDN).
Register a listener with addEventListener. Check readiness and browser support before you rely on this event.
Syntax
Listen for dblclick. Start with this line.
JavaScript
addEventListener("dblclick", fn)
Call
What it does
addEventListener("dblclick", fn)
Primary signature.
Built into the browser. Listen with el.addEventListener("dblclick", …) — no import required.
Library declarations
JavaScript
addEventListener("dblclick", fn)
Parameters
Parameter
Description
Event name
Required. "dblclick"
Handler prop
Optional. ondblclick
Return Value
Return Value
Description
*
Fires as an Element event (listener receives the Event object).
JavaScript Examples
Example 1 — Toggle a Label on Double-Click (MDN Idea)
MDN’s card demo, CSS-free: flip a size label when the user double-clicks.
JavaScript
const card = document.querySelector("button.card");
let large = false;
card.addEventListener("dblclick", () => {
large = !large;
card.textContent = large
? "Double-click me — size: LARGE"
: "Double-click me — size: normal";
});
Listen for both events. MDN: dblclick comes after two clicks.
Increment counters. A double-click raises clicks by 2, then dbls by 1.
Avoid double work. If click and dblclick both do heavy work, users feel lag.
Design carefully. Often handle only dblclick for the shortcut, or debounce click.
Compatibility
Browser Support
Elementdblclick is Baseline Widely available (MDN: since July 2015). Safe to use in modern and older evergreen browsers.
✓ Baseline · Widely available
dblclick
Fires when a pointing-device button is double-clicked on an element.
99%Widely available
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
dblclickExcellent
Bottom line: Use for optional shortcuts. Remember: two click events fire before dblclick, and touch double-tap support varies.
Frequently Asked Questions
It fires when a pointing-device button (usually the primary mouse button) is double-clicked on an element — two rapid clicks within a short time span (MDN).
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 by extension after two pairs of mousedown and mouseup) (MDN).
Usually no. Prefer click for main actions so keyboard and many touch 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.