liveBook · Manning

Event target

An event target is an object or node associated with an event as its origin or recipient during event dispatch.

How 3 Manning books explain it

Web Components in Action

event.target is the DOM event property identifying the original element on which an event occurred.

How it is used
Uses event.target to identify the originating element inside a broad document-level listener.
How deep it goes
Explains bubbling, listener targets, complete paths, and Shadow DOM paths through concrete Web Component examples.
Examples
Uses a clickable button, a custom element, a document listener, and logged propagation paths.
What you can do after
Diagnose event origins and propagation by logging target, currentTarget, and composedPath().

Read how Web Components in Action explains event target →

React Quickly, Second Edition

An event target is the DOM node on which a browser event occurred or to which it was dispatched.

How it is used
Identifies which DOM node triggered an event so one React handler can serve multiple controls.
How deep it goes
Explains target comparisons with refs and distinguishes event types, but defers broader event propagation details.
Examples
Uses an increment-and-decrement counter whose shared handler compares event.target with an increment-button ref.
What you can do after
Apply it via React event handlers to select an action based on the control that triggered the event.

Read how React Quickly, Second Edition explains event target →

Secrets of the JavaScript Ninja, Second Edition

The object or element on which an event originally occurred and which is exposed through the event object's target reference.

How it is used
Identifies the element where an event originated while handlers respond as it propagates through the DOM.
How deep it goes
Defines event.target and contrasts it with this during capturing and bubbling.
Examples
Uses a button click and nested-container click handlers to distinguish the target from the handler element.
What you can do after
Understand which element originated an event and distinguish it from the element handling the event.

Read how Secrets of the JavaScript Ninja, Second Edition explains event target →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.