event.delegateTarget is the element where a jQuery handler was attached — especially the delegation parent in .on("click", "button", fn). This tutorial covers the official .box demo, comparison with this and event.currentTarget, multiple containers, and identifying bind points for .off().
01
Property
delegateTarget
02
Delegate
Bind point
03
this
Matched child
04
Official
Highlight box
05
currentTarget
Often equal
06
Since 1.7
With .on()
Fundamentals
Introduction
Event delegation attaches one listener on a parent and filters events from children. When a nested button fires, you often need two elements: the clicked button (this) and the container you bound to (event.delegateTarget).
jQuery added event.delegateTarget in version 1.7 alongside unified .on() delegation. The official demo styles the entire .box red when any inner button is clicked — by targeting event.delegateTarget, not this.
Concept
Understanding event.delegateTarget
event.delegateTarget answers: where was this jQuery handler attached?
Delegated bind — $(".box").on("click", "button", fn) → delegateTarget is the .box element.
Matched child — this inside fn is the button that was clicked.
Direct bind — $("#btn").on("click", fn) → delegateTarget === currentTarget.
Cleanup — identify the delegation root when calling .off("click", "button", fn) on the correct parent.
💡
Beginner Tip
Click a button inside a panel: use $(this) to change the button, and $(event.delegateTarget) to highlight the whole panel — exactly like the official jQuery example.
📋 delegateTarget vs this vs currentTarget vs target
Four references in delegated handlers — know which container or child each names.
delegateTarget
event.delegateTarget
Where .on() attached
this
$(this)
Matched selector child
currentTarget
event.currentTarget
Handler owner (often = delegateTarget)
target
event.target
Deepest click origin
Hands-On
Examples Gallery
Example 1 follows the official jQuery demo. Examples 2–5 compare references, direct bindings, multiple boxes, and using the delegation root for cleanup.
📚 Official jQuery Demo
Click any button inside a box — turn the box background red via delegateTarget.
Example 1 — Official Demo: highlight .box on inner button click
Official jQuery demo — delegated click on button; style the attachment point with event.delegateTarget.
First button click → box turns red, handler removed from that box
Second click on same box → no further highlight (handler gone)
How It Works
Official docs note delegateTarget helps identify the delegation point for removing handlers — call .off() on that same element with the same event, selector, and function.
Applications
🚀 Common Use Cases
Highlight container — official .box background on inner button click.
Dynamic lists — one #list delegate; style delegateTarget on bulk actions.
Accordion panels — expand the panel (delegateTarget) when any header inside fires.
Teardown — .off() on the correct parent using event.delegateTarget.
Debug delegation — log delegateTarget vs this to verify bind points.
Nested delegates — know which ancestor owned the handler that ran.
🧠 How jQuery Sets event.delegateTarget
1
Bind with .on()
Attach on parent: $(parent).on("click", "child", fn) — jQuery records the parent as the delegate root.
Bind
2
Child event bubbles
User clicks nested element; jQuery tests selector match and invokes your handler.
event.delegateTarget is a jQuery event object property since jQuery 1.7+. It is set whenever jQuery invokes a bound handler — delegated or direct — and behaves consistently across browsers jQuery supports.
✓ jQuery 1.7+ · extension
jQuery event.delegateTarget
The element where your .on() handler was attached.
100%jQuery only
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
delegateTargetElement
Bottom line: Use delegateTarget for containers — use this for matched children.
Wrap Up
Conclusion
event.delegateTarget is the element where the current jQuery handler was attached. The official demo highlights the entire .box when any inner button is clicked — because delegateTarget points at the box, not the button.
Under delegation, pair $(this) for the matched child with $(event.delegateTarget) for the container. On direct binds, delegateTarget equals currentTarget.
Use $(event.delegateTarget) to style delegation containers
Call .off() on the same element you passed to .on()
Log delegateTarget and this while learning delegation
Prefer .on() delegation for dynamic child elements
Combine with event.data for action payloads on delegates
❌ Don’t
Assume this === event.delegateTarget under delegation
Confuse delegateTarget with event.target (click origin)
Style the whole panel with this when only the button matched
Call .off() on the child — remove from the delegate root
Use legacy .delegate() in new code — use .on()
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about event.delegateTarget
The .on() attachment point.
5
Core concepts
DT01
delegateTarget
Bind point
API
this02
Child
Matched selector
Delegate
CT03
Direct bind
Equals currentTarget
Rule
box04
Official
Red container
Demo
.off05
Cleanup
Delegation root
Tip
❓ Frequently Asked Questions
event.delegateTarget is the DOM element where the currently running jQuery event handler was attached. For delegated .on('click', 'button', fn) bindings, it is the ancestor you called .on() on — not the button that matched. Available since jQuery 1.7.
In delegated handlers, this is the element that matched the selector (e.g. the clicked button). event.delegateTarget is the parent where you attached the listener (e.g. the .box container). Use this to act on the clicked child; use delegateTarget to style or manage the delegation root.
For direct bindings, delegateTarget equals currentTarget. For delegated handlers in jQuery, both point at the element the handler is bound to — the delegation parent. delegateTarget is the jQuery-specific name for finding the attachment point, especially when removing delegated handlers.
Use it when a delegated handler needs to update the container — highlight the whole .box when any inner button is clicked (official demo), scope .off() to the correct parent, or distinguish which of several delegated roots fired when selectors overlap.
Yes. On a direct .on('click', fn) binding with no selector, delegateTarget is still set and equals currentTarget — the element you bound to.
No. It is a jQuery event object property added for delegated events alongside .on() and the older .delegate() API. Native events use currentTarget during bubbling; jQuery adds delegateTarget to name the bind point explicitly.
Did you know?
jQuery introduced event.delegateTarget when .on() replaced .bind(), .live(), and .delegate() in version 1.7. It gives delegated handlers an explicit name for the attachment element — so you can style the container or tear down the listener without guessing which ancestor was used.