The .dblclick() method is jQuery’s legacy shorthand for binding and triggering the dblclick event. This tutorial covers .dblclick(handler) since 1.0, .dblclick(eventData, handler) since 1.4.3, no-argument .dblclick() as a trigger, migration to .on("dblclick") and .trigger("dblclick"), and why the binding form is deprecated since jQuery 3.3. For the modern double-click API, see the jQuery dblclick event tutorial.
01
.dblclick(fn)
Bind handler
02
eventData
Since 1.4.3
03
.dblclick()
Trigger event
04
.on()
Modern bind
05
.trigger()
Modern fire
06
Deprecated
Since 3.3
Fundamentals
Introduction
Before jQuery 1.7 unified events with .on() and .off(), every common event had a matching shorthand — .click(), .dblclick(), .keydown(), and dozens more. The .dblclick() method let you bind a double-click handler in one short call: $("#row").dblclick(function(){ ... }). It remains in jQuery 3.x for backward compatibility but is marked deprecated.
Understanding .dblclick() matters when reading older tutorials, Stack Overflow answers, and legacy codebases that handle rename-on-double-click, zoom, and inline-edit patterns. The method does two distinct jobs: with a function argument it binds; with no arguments it triggers. Modern jQuery splits those roles explicitly — .on("dblclick", handler) for binding and .trigger("dblclick") for firing. This page documents the shorthand API and shows how to migrate.
Concept
Understanding the .dblclick() Method
The official jQuery API describes .dblclick() as a way to bind an event handler to the dblclick event, or trigger that event on an element. When you pass a handler, jQuery registers it on each matched element and calls it when the user completes two full click cycles inside that element within the OS double-click interval — the same dblclick event that .on("dblclick") handles today.
When you call .dblclick() with no arguments, jQuery synthetically fires the dblclick event on each matched element. Bound handlers run. This trigger behavior is equivalent to .trigger("dblclick").
⚠️
Deprecated since jQuery 3.3
Do not use .dblclick(handler) or .dblclick(eventData, handler) in new code. Replace them with .on("dblclick", handler) or .on("dblclick", eventData, handler). Replace no-argument .dblclick() with .trigger("dblclick"). For click conflicts, delegation, and the full modern guide, read the jQuery dblclick event tutorial.
Foundation
📝 Syntax
The .dblclick() method has three signatures from the official jQuery API. The binding forms are deprecated; the trigger form remains valid but .trigger("dblclick") is preferred:
All .dblclick() signatures return the original jQuery object for chaining.
Handler return values are ignored unless you use return false (equivalent to preventDefault() + stopPropagation()).
Cheat Sheet
⚡ Quick Reference
Goal
Legacy (.dblclick)
Modern replacement
Bind double-click handler
$("#row").dblclick(fn) ⚠
$("#row").on("dblclick", fn)
Pass data to handler
$("#row").dblclick({ mode: "edit" }, fn) ⚠
$("#row").on("dblclick", { mode: "edit" }, fn)
Trigger dblclick programmatically
$("#target").dblclick()
$("#target").trigger("dblclick")
Trigger all matched elements
$(".item").dblclick()
$(".item").trigger("dblclick")
Remove dblclick handlers
$("#row").off("dblclick")
Delegated dblclick on children
$("#list").on("dblclick", "li", fn) — not available via .dblclick()
One-time double-click
$("#row").one("dblclick", fn) — use .one(), not .dblclick()
Compare
📋 .dblclick() vs .on("dblclick") vs .trigger("dblclick") vs .click()
Four related APIs — know which handles double-click, which is modern, and which covers single-click only.
.dblclick()
deprecated
Legacy bind (.dblclick(fn)) or trigger (.dblclick()) — migrate for new code
.on("dblclick")
bind
Modern binding since 1.7 — supports eventData, delegation, and click-delay patterns
.trigger("dblclick")
fire
Programmatically run handlers — clearer than no-arg .dblclick()
.click()
single only
Separate deprecated shorthand for single-click — does not replace double-click handlers
Hands-On
Examples Gallery
Five examples cover binding, eventData, triggering, migration from .dblclick() to .on("dblclick"), and method chaining. Use the Try-it links and double-click inside the demo area. Remember: binding with .dblclick(handler) is deprecated — these demos show legacy syntax you will encounter in older code.
📚 Binding & Triggering
Legacy .dblclick() signatures for binding handlers and firing events programmatically.
Example 1 — Bind Handler with .dblclick(handler) on #target
The canonical legacy pattern — attach a function that runs when the user double-clicks the element.
jQuery
$( "#target" ).dblclick( function() {
$( "#out" ).text( "Handler ran via .dblclick(function(){ ... })." );
} );
User double-clicks #target → handler runs
#out text updates to confirm .dblclick(fn) fired
Deprecated — prefer .on("dblclick", fn) for new code
How It Works
.dblclick(fn) registers the function on #target. jQuery internally routes this to .on("dblclick", fn). The handler runs once per completed double-click — two full click cycles inside the element within the OS double-click interval.
Example 2 — Pass eventData with .item Files
Since jQuery 1.4.3, pass an object before the handler — it arrives as event.data on every matched .item element.
Double-click File A → "Double-clicked: File A | eventData.action: open"
Double-click File B → same eventData.action on every .item element
Modern equivalent: .on("dblclick", { action: "open" }, fn)
How It Works
jQuery stores the { action: "open" } object and injects it into event.data when any matched .item is double-clicked. Use $(this).data("label") for per-element attributes like file names.
Example 3 — Trigger Dblclick with No-Argument .dblclick() from #fire Click
Calling .dblclick() without a handler fires the dblclick event programmatically.
The first .dblclick(function(){ ... }) binds a handler on #target. A single click on #fire calls $("#target").dblclick() with no arguments — that synthetically fires the dblclick event. Replace with $("#target").trigger("dblclick") for clarity.
📈 Migration & Chaining
Compare legacy and modern APIs, and chain after .dblclick(handler).
Example 4 — Migration: .dblclick(fn) vs .on("dblclick", fn)
Both bind the same dblclick event — .on() is the recommended API for new code.
jQuery
$( "#legacy" ).dblclick( function() {
$( "#out" ).text( "Legacy: .dblclick(function(){ ... }) — deprecated since jQuery 3.3." );
} );
$( "#modern" ).on( "dblclick", function() {
$( "#out" ).text( "Modern: .on('dblclick', function(){ ... }) — use this for new code." );
} );
Double-click #legacy → legacy deprecation message
Double-click #modern → modern .on("dblclick") message
Behavior is identical — only the API name differs
How It Works
Under the hood, .dblclick(fn) calls .on("dblclick", fn). Migration is a straight rename with no behavior change for simple bindings. The advantage of .on() is delegation — $("#list").on("dblclick", "li", fn) — which .dblclick() cannot do.
Example 5 — Chaining .dblclick(fn).addClass("has-dbl")
.dblclick(handler) returns the jQuery object — chain further methods immediately.
jQuery
$( "#panel" )
.dblclick( function() {
$( "#out" ).text( "Double-clicked — .has-dbl class was added at setup." );
} )
.addClass( "has-dbl" );
On page load → #panel receives .has-dbl class immediately
Double-click #panel → #out updates with confirmation message
.addClass("has-dbl") runs once at setup — not on each double-click
Same chaining works with .on("dblclick", fn).addClass("has-dbl")
How It Works
.dblclick(fn) returns the jQuery collection, so .addClass("has-dbl") runs immediately during initialization — marking the panel as double-click enabled. The handler runs only when the user double-clicks. The same chaining pattern works with .on("dblclick", fn).
Applications
🚀 Common Use Cases
Reading legacy code — recognize $("#row").dblclick(fn) as equivalent to .on("dblclick", fn) when maintaining older projects.
Inline rename — legacy file managers often used .dblclick(fn) to open rename dialogs — migrate to .on("dblclick") with the same handler logic.
Stacked handlers — multiple .dblclick(fn) calls on one element run in registration order — same as multiple .on("dblclick", fn) calls.
Automated testing — test suites may call .dblclick() to simulate double-clicks — consider .trigger("dblclick") for explicit intent.
🧠 How .dblclick() Routes Through jQuery
1
You call .dblclick()
With a function argument, jQuery treats it as a bind request. With no arguments, it treats it as a trigger request.
dispatch
2
Bind path
.dblclick(handler) delegates internally to .on("dblclick", handler) — the handler is stored in jQuery’s event system.
.on("dblclick")
3
Trigger path
No-arg .dblclick() delegates to .trigger("dblclick") — bound handlers run on each matched element.
.trigger("dblclick")
4
👉
jQuery object returned
Both paths return the original collection for chaining — .dblclick(fn).addClass("has-dbl") works the same as .on("dblclick", fn).addClass("has-dbl").
Important
📝 Notes
Deprecated since jQuery 3.3 — do not use .dblclick(handler) or .dblclick(eventData, handler) in new code. Use .on("dblclick") instead.
Bind with .dblclick(handler) since jQuery 1.0; eventData form since 1.4.3.
No-argument .dblclick() triggers the event since jQuery 1.0 — prefer .trigger("dblclick").
.dblclick() does not support event delegation — use .on("dblclick", selector, fn) for dynamic lists.
Avoid binding both .click() and .dblclick() on the same element — browsers may fire extra click events before dblclick.
Legacy code using .dblclick() still runs in jQuery 3.x — migrate when you refactor those files.
For the full modern dblclick guide — click conflicts, delegation, and trigger patterns — see the jQuery dblclick event tutorial.
Compatibility
Browser Support
The underlying dblclick event is a standard DOM event supported in every browser jQuery targets. The .dblclick() method itself is a jQuery API — it works in jQuery 1.x, 2.x, and 3.x. Binding via .dblclick(handler) is deprecated since 3.3 but still functional; triggering via no-arg .dblclick() also remains supported.
✓ jQuery 1.0+
jQuery .dblclick() method
Supported across all jQuery versions you are likely to maintain. Deprecated binding since 3.3 — use .on('dblclick') for new projects. Native equivalent for binding: element.addEventListener('dblclick', fn). Native equivalent for trigger: dispatchEvent or synthetic dblclick.
100%With jQuery loaded
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
.dblclick()Legacy API
Bottom line: Safe in legacy jQuery projects. Migrate bindings to .on('dblclick') and triggers to .trigger('dblclick') when updating code.
Wrap Up
Conclusion
The jQuery .dblclick() method is the legacy shorthand for binding and triggering double-click handlers. Use .dblclick(handler) or .dblclick(eventData, handler) to bind — both deprecated since jQuery 3.3. Use no-argument .dblclick() to trigger — equivalent to .trigger("dblclick").
For new code, prefer .on("dblclick", fn) for binding and .trigger("dblclick") for programmatic firing. When you encounter .dblclick() in older projects, recognize it, understand it, and migrate when practical. For click conflicts, delegation, and the complete modern double-click workflow, continue with the jQuery dblclick event tutorial.
Assume .click(handler) handles double-clicks — it does not
Assume .dblclick() supports delegation — it does not
Confuse .dblclick(fn) (bind) with .dblclick() (trigger)
Bind both .click() and .dblclick() on the same element without a delay pattern
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about .dblclick()
Legacy bind, modern migrate.
6
Core concepts
.dbl01
.dblclick(fn)
Bind
Deprecated
data02
eventData
Since 1.4.3
Handler
()03
.dblclick()
Trigger
No args
.on04
.on("dblclick")
Modern
Replace
⚡05
.trigger()
Fire
Programmatic
3.306
Deprecated
Since 3.3
Migrate
❓ Frequently Asked Questions
The .dblclick() method has two roles. With a handler argument — .dblclick(handler) or .dblclick(eventData, handler) — it binds a function that runs when the user double-clicks the matched element. With no arguments — .dblclick() — it triggers the dblclick event on each matched element. Both forms have been part of jQuery since 1.0; the binding form is deprecated since 3.3.
Yes — the binding signatures .dblclick(handler) and .dblclick(eventData, handler) are deprecated since jQuery 3.3. Use .on('dblclick', handler) or .on('dblclick', eventData, handler) instead. The no-argument .dblclick() trigger form still works but .trigger('dblclick') is clearer and preferred in modern code. Existing legacy code continues to run in jQuery 3.x; migrate when you touch those files.
.dblclick(handler) registers a callback — it does not fire the event immediately. .dblclick() with no arguments triggers the dblclick event programmatically on every matched element, the same as .trigger('dblclick'). The handler form is deprecated for binding; the no-arg form is a trigger shorthand. Always check whether parentheses contain a function before reading legacy jQuery code.
Replace .dblclick(fn) with .on('dblclick', fn). Replace .dblclick(data, fn) with .on('dblclick', data, fn). Replace no-arg .dblclick() with .trigger('dblclick'). Replace .unbind('dblclick') cleanup with .off('dblclick'). Under the hood, .dblclick(handler) already delegates to .on('dblclick') — migration is a straight rename with no behavior change for simple bindings.
Yes. jQuery 3.x keeps .dblclick() for backward compatibility with jQuery 1.x and 2.x codebases. It still binds and triggers correctly. The API docs mark it deprecated to steer new projects toward .on() and .trigger(). Do not use .dblclick(handler) in new code — prefer the modern API covered in the jQuery dblclick event tutorial.
.click() handles a single press-and-release inside an element. .dblclick() handles two complete click cycles within the OS double-click interval — both must occur inside the same element. They are separate events. Binding both on one element can cause extra click events before dblclick fires; the jQuery API advises against it. Use .on('dblclick') for double-click and .on('click') for single-click in modern code.
Did you know?
jQuery deprecated event shorthand methods in stages — .click(handler) and .dblclick(handler) were both marked deprecated in version 3.3, while the unified .on() API arrived much earlier in 1.7. Under the hood, .dblclick(fn) has always been a thin wrapper around .on("dblclick", fn), so migrating legacy double-click code is often a one-line rename with no runtime behavior change.