jQuery event.delegateTarget

Beginner
5 min read
Updated: Nov 2026
3 examples
Events

Definition

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.

Syntax

Start with these common calls. Keep them short and readable.

jQuery
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
CallWhat it does
Parent collectionWhere .on() is called → delegateTarget
SelectorFilter which children run the handler
thisMatched child element
event.delegateTargetAttach parent element

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Choose a stable parent ($(".box"), $("#list"), …).
Step 2Bind with a selector: .on("click", "button", handler).
Step 3Inside the handler, use this for the matched child.

Return Value

Return ValueDescription
See examplesCheck the examples below for what this API returns in common cases.

jQuery Examples

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.

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.

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.

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

Cancel default browser actions from a handler.

event.preventDefault() Method tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

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