jQuery event.delegateTarget

Beginner
6 min read
Updated: Oct 2026
5 examples
Live preview

What Is event.delegateTarget?

event.delegateTarget is the DOM element where the handler was attached. Most useful with delegated .on("click", "button", fn) — it names the ancestor, not the matched child. Added in jQuery 1.7.

Remember
event.delegateTarget  // Element — where .on() was called
event.currentTarget   // Element — usually === this (matched / handler element)
event.target          // Element — deepest click origin

// Official idea
$(".box").on("click", "button", function (event) {
  $(event.delegateTarget).css("background-color", "red");
  // this = button; delegateTarget = .box
});

// Direct bind (no selector):
//   delegateTarget === currentTarget
NeedUse
Attach parentevent.delegateTarget
Matched childthis / event.currentTarget
Click originevent.target
Delegate bind.on("click", "button", fn)
Remove at root$(event.delegateTarget).off(…)

How to Use event.delegateTarget

Bind on a parent, match children, then read the attach point from the event.

  1. Choose a stable parent ($(".box"), $("#list"), …).
  2. Bind with a selector: .on("click", "button", handler).
  3. Inside the handler, use this for the matched child.
  4. Use event.delegateTarget when you need the parent container.
  5. Wrap with $(event.delegateTarget) before calling jQuery methods.
PieceRequired?Role
Parent collectionYesWhere .on() is called → delegateTarget
SelectorFor delegationFilter which children run the handler
this—Matched child element
event.delegateTarget—Attach parent element

Pseudocode

Pseudocode
parent.on("click", "childSelector", handler)

when click happens on a matching child (or inside it):
    this / currentTarget     = matched child
    event.delegateTarget     = parent   // attach point
    event.target             = deepest origin
    call handler(event)

// Direct bind (no selector):
parent.on("click", handler)
    delegateTarget === currentTarget === parent

Cheat Sheet

Keep these facts handy while debugging delegated handlers.

TopicDetail
TypeDOM Element (not a jQuery object)
SincejQuery 1.7
Official demoStyle .box via delegateTarget
DelegatedParent = delegateTarget; child = this
Direct binddelegateTarget === currentTarget
Wrap$(event.delegateTarget)
Standard DOM?No — jQuery event property
Official docsapi.jquery.com/event.delegateTarget

Live Preview

Click a button inside either box. The log shows this vs delegateTarget — same idea as the official jQuery API demo.

Boxes

Bound with $(".dt-box").on("click", "button", …) — click either button.

Box A

Box B

Log
Waiting — click a button inside a box.

jQuery Examples

Short, copy-ready snippets. Open DevTools, or use Try It Yourself for a live editor.

Example 1 — Official: Paint the Box

Click a button; style event.delegateTarget (the .box).

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

How It Works

  1. Bind. Each .box listens for clicks on nested buttons.
  2. Click. The matched element is the button (this).
  3. Root. event.delegateTarget is the .box that owns the listener.
  4. Style. Painting the delegate target highlights the whole container.

Example 2 — Compare this, currentTarget, delegateTarget

Log all three so the child vs parent roles are obvious.

jQuery
$("#list").on("click", "li", function (event) {
  $("#out").text(
    "this: " + this.tagName + " (" + $(this).text() + ")\\n" +
    "currentTarget: " + event.currentTarget.tagName + "\\n" +
    "delegateTarget: #" + event.delegateTarget.id
  );
});
Try It Yourself

How It Works

  1. Attach. The listener lives on #list.
  2. Match. Clicking a row sets this to that li.
  3. currentTarget. Matches this for the delegated child.
  4. delegateTarget. Remains #list — the bind parent.

Example 3 — Direct Bind: Equal Targets

With no selector, delegateTarget equals currentTarget.

jQuery
$("#btn").on("click", function (event) {
  $("#out").text(
    "same? " +
    (event.delegateTarget === event.currentTarget) +
    "\\nid: " + event.delegateTarget.id
  );
});
Try It Yourself

How It Works

  1. Direct. No selector — the handler is on #btn itself.
  2. Click. Both properties point at that same element.
  3. Rule. Official docs: non-delegated → always equal.
  4. Use. delegateTarget still exists; it is just redundant here.

Example 4 — Remove Handlers at the Root

Use delegateTarget to .off() the parent that owns the delegated bind.

jQuery
$("#panel").on("click", "button.act", function (event) {
  $("#out").text("Clicked: " + $(this).text());
  if ($(this).data("once")) {
    $(event.delegateTarget).off("click", "button.act");
    $("#out").append("\\nHandlers removed from #" + event.delegateTarget.id);
  }
});
Try It Yourself

How It Works

  1. Delegate. Buttons inside #panel share one listener.
  2. Act. Normal clicks update the log.
  3. Once. A special button removes the delegated handler.
  4. Root. .off() runs on event.delegateTarget — the attach point.

Example 5 — Label Which Box Fired

Several roots share one handler function; delegateTarget names the container.

jQuery
function onBtn(event) {
  $("#out").text(
    "Button in #" + event.delegateTarget.id +
    " → " + $(this).text()
  );
}

$(".card").on("click", "button", onBtn);
Try It Yourself

How It Works

  1. Many roots. Each .card gets the same delegated bind.
  2. Shared fn. One function handles every card.
  3. Identify. event.delegateTarget.id names which card fired.
  4. Child. $(this).text() is the clicked button label.

Edge Cases & Pitfalls

Watch for these when reading event.delegateTarget.

vs this

Do not confuse with this

Delegated this is the matched child. The parent is event.delegateTarget.

currentTarget

Not always equal to currentTarget

Equal on direct binds. On delegated binds, currentTarget is the child; delegateTarget is the parent.

wrap

Raw DOM node

Use $(event.delegateTarget) before .css(), .off(), or .addClass().

jquery

jQuery-only property

Not a standard DOM Event field. Rely on it inside jQuery handlers, not bare addEventListener.

Browser Support

event.delegateTarget is a jQuery event-object property (not a native DOM field). Available since jQuery 1.7 with .on() / .delegate(). Works wherever your loaded jQuery version runs.

✓ Stable · jQuery 1.7+

event.delegateTarget

Supported in jQuery 1.7–3.x. Prefer .on(parent, selector, handler) for modern delegation. Native equivalent for the child is currentTarget; the attach parent is a jQuery concept.

100% With jQuery 1.7+
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 jQuery 1.7+

Bottom line: Safe for production with jQuery 1.7+. Use it to reach the .on() attach parent from a delegated handler.

Performance Notes

ApproachCostBest for
Delegated .on(parent, sel, fn)CheapMany / dynamic children
Read event.delegateTargetFreeUpdating the container
Bind every child directlyMore listenersAvoid when the list grows

Reading delegateTarget has no meaningful cost. Delegation itself is the win — one listener on a parent instead of one per child.

Key Takeaways

  • Role: element where the jQuery handler was attached.
  • Delegation: parent = delegateTarget; child = this.
  • Direct bind: delegateTarget === currentTarget.
  • Use: style the container, or .off() at the bind point.

One line: event.delegateTarget is “where I called .on()” — the delegation root.

Frequently Asked Questions

event.delegateTarget is the DOM element where the currently running jQuery handler was attached. For $(".box").on("click", "button", fn), it is the .box ancestor — not the button. Available since jQuery 1.7.
In a delegated handler, this (and usually event.currentTarget) is the element that matched the selector — the clicked button. event.delegateTarget is the parent where you called .on(). Use this for the child; use delegateTarget for the container.
On a direct bind (no selector), yes — delegateTarget equals currentTarget. On a delegated bind, currentTarget is the matched child; delegateTarget is the attach parent.
When a delegated handler must update the container (official .box highlight), call .off() at the bind point, or tell which of several delegated roots handled the event.
Yes. For .on("click", fn) with no selector, delegateTarget is still set and equals currentTarget — the element you bound to.
No. It is a jQuery event-object property for naming the attach point. Native events expose currentTarget during bubbling; jQuery adds delegateTarget for delegated .on() / .delegate() handlers.

Next: event.preventDefault()

Cancel default browser actions from a handler.

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.

10 people found this page helpful