Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / JavaScript

Event.currentTarget — the object handling an event

Event.currentTarget identifies the object whose listener is currently being invoked. Unlike event.target, it describes where the event is handled, not its target.

Version: ECMAScript and Web APIs; exact feature edition and browser support reviewed per entry; Node 24 in repository does not prove browser API support

Syntax

event.currentTarget

Event.currentTarget is a read-only property returning an EventTarget or null. During a listener invocation, it identifies the object on which that listener was registered; this need not be an element.

event.target denotes the event's target, subject to Shadow DOM retargeting. event.currentTarget identifies the current handling location during capturing and bubbling. In the example, the target is child, while the listener runs on parent.

Before dispatch begins and after dispatch finishes, currentTarget is null. If you need that object later, for example after await, save it during synchronous handling rather than reading the property later from the retained event.

Examples

const parent = document.createElement('div');
const child = document.createElement('button');
parent.append(child);

const event = new Event('demo', { bubbles: true });
let savedTarget;

parent.addEventListener('demo', (event) => {
  savedTarget = event.currentTarget;
  console.log(event.target === child);
  console.log(event.currentTarget === parent);
});

child.dispatchEvent(event);
console.log(event.currentTarget === null);
console.log(savedTarget === parent);

Result

true
true
true
true

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources