← Chrome 147 reference

v147 · shipped · dom · events

Pseudo target on events

Chrome 147 adds a pseudoTarget property to UIEvent, AnimationEvent, and TransitionEvent. When an event originates from a CSS pseudo-element such as ::before or ::after, pseudoTarget returns the corresponding CSSPseudoElement object rather than null, letting event handlers distinguish pseudo-element interactions without relying on hit-test workarounds.

at a glance

Shipped inChrome 147 (desktop, Android, WebView)
StatusEnabled by default
New propertyEvent.pseudoTarget
ReturnsCSSPseudoElement or null
SpecCSS Pseudo-Elements Level 4
ChromeStatus5179328935624704 — Pseudo target on events

why it exists

CSS pseudo-elements like ::before and ::after generate rendered content and are fully interactive — they receive pointer events, fire animation events, and participate in transitions. Before Chrome 147, Event.target always referred to the originating DOM element, with no way to tell programmatically that the interaction happened on a pseudo-element rather than the element itself. Developers resorted to geometry calculations or layout mirrors to infer the hit. pseudoTarget closes this gap directly in the event object.

Source: blink-dev Intent to Ship — Pseudo target on events, April 2026.

shape of the API

The pseudoTarget property

Every UIEvent, AnimationEvent, and TransitionEvent now carries a pseudoTarget property:

Supported event types

InterfaceTypical events
UIEventclick, pointerdown, focus, keydown, …
AnimationEventanimationstart, animationend, animationiteration
TransitionEventtransitionstart, transitionend, transitionrun

Note: mouseover, mouseout, mouseenter, mouseleave, and their pointer* hover counterparts are not yet supported.

Source: blink-dev Intent to Ship — Pseudo target on events, April 2026.

example

Detecting a click on ::after

const box = document.querySelector('.box');

box.addEventListener('click', (event) => {
  if (event.pseudoTarget !== null) {
    console.log('Clicked on pseudo-element:', event.pseudoTarget.type);
    // e.g. "::after"
    console.log('Originating element:', event.pseudoTarget.element);
  } else {
    console.log('Clicked on the element itself');
  }
});

Reacting to a transition on ::before

document.addEventListener('transitionend', (event) => {
  if (event.pseudoTarget?.type === '::before') {
    // A ::before pseudo-element finished its CSS transition
    const host = event.pseudoTarget.element;
    host.classList.remove('transitioning');
  }
});
Source: blink-dev Intent to Ship — Pseudo target on events, April 2026.

browser support

BrowserSupport
Chrome 147+ (desktop, Android, WebView)Enabled by default
FirefoxNo signal
SafariNo signal
Source: chromestatus.com feature page, April 2026.

see also