jQuery event.target Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Events

Definition

event.target is the DOM element that initiated the event — often a descendant of the element that registered the handler. Since jQuery 1.0. Compare with this to detect bubbling, and use it for event delegation. Contrast with currentTarget (handler element) and relatedTarget (other element on mouse enter/leave).

Syntax

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

jQuery
event.target          // Element that started the event
event.currentTarget   // Element whose handler is running
this                  // Usually === currentTarget

// Official pattern — log the tag name
$("body").on("click", function (event) {
  $("#log").html("clicked: " + event.target.nodeName);
});
CallWhat it does
event argumentjQuery event object
event.targetDeepest initiating element
$(event.target)jQuery methods on the origin
event.target === thisDetect direct vs bubbled click

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

Parameters

ParameterDescription
eventtargetUsed in $(event.target). jQuery methods on the origin

Return Value

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

jQuery Examples

Example 1 — Official nodeName Log

Click nested blocks; log the initiating tag.

jQuery
$("body").on("click", function (event) {
  if ($(event.target).closest("#out").length) return;
  $("#out").text("clicked: " + event.target.nodeName);
});
Try It Yourself

How It Works

  1. Body handler. One listener for the whole page.
  2. Skip the log. Ignore clicks on the output itself.
  3. Read target. nodeName is the tag in uppercase.

Example 2 — Official ul Delegation Toggle

Click an li to toggle its nested list — official pattern.

jQuery
function handler(event) {
  var target = $(event.target);
  if (target.is("li")) {
    target.children("ul").toggle();
  }
}

$("ul").first().on("click", handler).find("ul").hide();
Try It Yourself

How It Works

  1. One bind. Handler sits on the outer ul.
  2. Filter. Act only when target.is("li").
  3. Toggle. Show/hide that row’s child ul.

Example 3 — target vs currentTarget

Click the icon inside a button — origins differ.

jQuery
$("#save").on("click", function (event) {
  $("#out").text(
    "target: " + event.target.tagName +
    " | currentTarget: #" + event.currentTarget.id
  );
});
Try It Yourself

How It Works

  1. Handler on button. currentTarget stays #save.
  2. Icon click. Deepest node is the SPAN.
  3. Button click. Target can be the button itself.

Frequently Asked Questions

event.target is the DOM element that initiated the event — the deepest element the user interacted with. Available since jQuery 1.0. It is a native Element, not a jQuery collection.
event.target is where the event started. event.currentTarget is the element whose handler is running. Click a span inside a button: target is the span; currentTarget on the button handler is the button.
When event.target === this, the user interacted with the bound element itself. When they differ, the event bubbled from a descendant — useful for nested icons, links inside rows, or panel backgrounds.
Bind one handler on a parent, then inspect $(event.target) with .is(), .closest(), or a selector filter before acting. The official ul demo uses target.is("li") to toggle nested lists only when an li was clicked.
No. event.target is the element for the current event. event.relatedTarget is the other element in mouseover/mouseout transitions. relatedTarget is for mouse enter/leave style events; target applies to all event types.
Only when you want jQuery methods. event.target.nodeName is fine on the native element. Use $(event.target).is("li") or .closest(".tool") when you need the jQuery API.

Next: event.data Property

Pass and read custom data from your .on() bindings.

event.data Property 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