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 in | Chrome 147 (desktop, Android, WebView) |
|---|---|
| Status | Enabled by default |
| New property | Event.pseudoTarget |
| Returns | CSSPseudoElement or null |
| Spec | CSS Pseudo-Elements Level 4 |
| ChromeStatus | 5179328935624704 — Pseudo target on events |
Status and specification divergence, both sides reported rather than resolved (fetched 2026-10-06): this page
records the property as Enabled by default in Chrome 147, while ChromeStatus feature
5179328935624704 reads status “Proposed” with is_released false and no intent
stage. On the specification side, this page names css-pseudo-4, but the record’s own spec link points at a UI Events pull request, and the fetched css-pseudo-4 contains no occurrence of pseudoTarget,
UIEvent, AnimationEvent or TransitionEvent — it defines only the
CSSPseudoElement interface this property returns, which MDN likewise documents without naming the
property. The page is also inconsistent with itself about which events carry it: the lede names
UIEvent, AnimationEvent and TransitionEvent while the at-a-glance row says
Event.pseudoTarget.
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.
Syntax
The specification change is w3c/uievents PR #413 “Add .pseudoTarget property to selected event types” — still an open pull request as of 2026-10-18, not merged UI Events text. Its IDL additions, verbatim: to the UIEvent interface
readonly attribute CSSPseudoElement? pseudoTarget;
and to the UIEventInit dictionary
CSSPseudoElement? pseudoTarget = null;
Nullability per the PR and its review thread: the attribute is null when the event did not originate from a pseudo-element, when currentTarget is null (including after dispatch has finished — the author confirmed on 2026-07-08 it would be “always null after dispatch”), and when Shadow DOM retargeting against currentTarget would otherwise expose shadow-internal nodes. Disclosed: the PR’s visible IDL covers UIEvent (whose subtypes inherit it); AnimationEvent and TransitionEvent are Event subtypes, so their coverage — named by the lede and the intent below — is not in that IDL fragment and rests on the intent and Chrome’s implementation (runtime flag EventPseudoTargetProperty, status: "stable", depends_on CSSPseudoElementInterface in the runtime flag registry, read 2026-10-18).
shape of the API
The pseudoTarget property
Every UIEvent, AnimationEvent, and TransitionEvent now carries a pseudoTarget property:
- If the event was dispatched on a pseudo-element,
pseudoTargetis aCSSPseudoElementwhosetypeis the pseudo-element selector (e.g."::before") and whoseelementis the originating DOM element. - If the event was not dispatched on a pseudo-element,
pseudoTargetisnull. Event.targetremains the originating DOM element in both cases — existing code is unaffected.
Supported event types
| Interface | Typical events |
|---|---|
UIEvent | click, pointerdown, focus, keydown, … |
AnimationEvent | animationstart, animationend, animationiteration |
TransitionEvent | transitionstart, transitionend, transitionrun |
Note: mouseover, mouseout, mouseenter, mouseleave, and their pointer* hover counterparts are not yet supported.
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 compatibility
| Browser | pseudoTarget |
|---|---|
| Chrome (desktop) | 147 |
| Chrome Android / WebView | 147 |
| Edge | Not separately reported |
| Firefox | No — no signal |
| Safari | No — no signal |
BCD api/UIEvent.json has no pseudoTarget entry yet (verified 2026-10-18), so this table is interim data from the ChromeStatus record, labelled as such; vendor rows reflect the record’s “No signal” views.
Specifications
| Specification | Status |
|---|---|
| UI Events — w3c/uievents PR #413, “Add .pseudoTarget property to selected event types” | Open pull request (not merged as of 2026-10-18) |
CSS Pseudo-Elements Level 4 — the CSSPseudoElement interface the property returns | Editor’s Draft |