jQuery event.delegateTarget

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Event object · jQuery 1.7+

What You’ll Learn

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()

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.

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 childthis 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.

📝 Syntax

Read inside any jQuery handler (since 1.7):

jQuery
event.delegateTarget

// delegated handler:
$( ".box" ).on( "click", "button", function ( event ) {
  $( event.delegateTarget ).css( "background-color", "red" );
  $( this ).addClass( "was-clicked" ); // the button
});

// direct handler — equals currentTarget:
$( "#solo" ).on( "click", function ( event ) {
  console.log( event.delegateTarget === event.currentTarget ); // true
});

Type

  • Element — native DOM element where the handler was attached.

Return value

  • Read-only property on the jQuery event object for the current handler invocation.

Official jQuery API example

jQuery
$( ".box" ).on( "click", "button", function ( event ) {
  $( event.delegateTarget ).css( "background-color", "red" );
});

⚡ Quick Reference

Bindingthisevent.delegateTarget
.on("click", fn) directBound elementSame element
.on("click", "button", fn)Clicked buttonParent .on() target
Style containerUse delegateTargetOfficial .box demo
Style clicked childUse thisNot delegateTarget
vs currentTargetEqual on direct bind

📋 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

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.

jQuery
$( ".box" ).on( "click", "button", function ( event ) {
  $( event.delegateTarget ).css( "background-color", "red" );
});
Try It Yourself

How It Works

The handler is bound on .box, not on each button. event.delegateTarget references that box — the element jQuery attached the delegated listener to.

Example 2 — Delegation: delegateTarget vs this

Log both — parent container vs matched button.

jQuery
$( "#panel" ).on( "click", "button", function ( event ) {
  console.log( "delegateTarget:", event.delegateTarget.id ); // "panel"
  console.log( "this:", this.tagName );                       // "BUTTON"
});
Try It Yourself

How It Works

jQuery sets this to the element matching the delegate selector. event.delegateTarget stays the #panel you called .on() on.

📈 Practical Patterns

Direct binds, multiple roots, and handler cleanup.

Example 3 — Direct Bind: delegateTarget === currentTarget

Without a delegate selector, delegateTarget equals currentTarget — both are the bound element.

jQuery
$( "#solo" ).on( "click", function ( event ) {
  console.log( event.delegateTarget === event.currentTarget ); // true
  console.log( event.delegateTarget === this );                // true
});
Try It Yourself

How It Works

Official docs: for non-delegated handlers, event.delegateTarget is always equal to event.currentTarget.

Example 4 — Multiple Boxes: only the clicked box turns red

Each .box has its own delegated handler — delegateTarget identifies which box was the bind point.

jQuery
$( ".box" ).on( "click", "button", function ( event ) {
  $( ".box" ).css( "background-color", "" );
  $( event.delegateTarget ).css( "background-color", "red" );
});
Try It Yourself

How It Works

One .on() call on a jQuery collection binds per element. Each handler’s delegateTarget is the specific box that owns that listener.

Example 5 — Cleanup: .off() on the delegation root

Remove delegated handlers from the element referenced by event.delegateTarget.

jQuery
function onBoxClick( event ) {
  if ( event.data && event.data.once ) {
    $( event.delegateTarget ).off( "click", "button", onBoxClick );
  }
  $( event.delegateTarget ).css( "background-color", "red" );
}
$( ".box" ).on( "click", "button", { once: true }, onBoxClick );
Try It Yourself

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.

🚀 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.

Bubble
3

Set references

this = matched child; delegateTarget = parent bind point; target = click origin.

Context
4

Use delegateTarget

Style or unbind at the delegation root — $(event.delegateTarget).

📝 Notes

  • Available since jQuery 1.7 — added with unified .on() delegation.
  • Most useful for delegated handlers from .on() or legacy .delegate().
  • Non-delegated: delegateTarget === currentTarget (official docs).
  • Not the same as this under delegation — this is the matched child.
  • jQuery-specific property — not a standard DOM Event field name in all browsers without jQuery.
  • Pair with event.currentTarget and event.data for full handler context.

Browser Support

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 Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
delegateTarget Element

Bottom line: Use delegateTarget for containers — use this for matched children.

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.

💡 Best Practices

✅ Do

  • 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()

Key Takeaways

Knowledge Unlocked

Five things to remember about event.delegateTarget

The .on() attachment point.

5
Core concepts
this 02

Child

Matched selector

Delegate
CT 03

Direct bind

Equals currentTarget

Rule
box 04

Official

Red container

Demo
.off 05

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.

Next: event.preventDefault()

Cancel link navigation and form submit with preventDefault().

event.preventDefault() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful