JavaScript Event explicitOriginalTarget Property

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Non-standard
Instance property

What You’ll Learn

The explicitOriginalTarget property is a read-only, non-standard Mozilla Event field for the non-anonymous original target. Learn how it differs from target / originalTarget, why Firefox retargets some mouse events over text nodes, and how to feature-detect—with five examples and try-it labs.

01

Kind

Instance property

02

Type

EventTarget | null

03

Status

Non-standard

04

Engine

Mainly Firefox

05

Portable alt

event.target

06

Workers

Also available

Introduction

Most tutorials teach event.target—the element the browser reports as the event’s target. In Firefox, Gecko sometimes retargets an event (for example, when a mouse event happens over a text node, it may surface the parent element instead).

explicitOriginalTarget is Mozilla’s way to still see the non-anonymous original target before that retargeting. It is useful for understanding Firefox internals and legacy XUL command demos—not for cross-browser production apps.

💡
Beginner tip

Always gate reads with "explicitOriginalTarget" in event (or check typeof event.explicitOriginalTarget !== "undefined"). On Chrome/Safari/Edge the property is usually missing.

Understanding Event.explicitOriginalTarget

An instance property that returns the non-anonymous original EventTarget of the event.

  • Value — an EventTarget, or null if there isn’t one.
  • Read-only — you inspect it; you do not assign to it.
  • Retargeting — if Firefox retargets for reasons other than an anonymous boundary, this can keep the pre-retarget target.
  • vs originalTarget — never contains anonymous content (per MDN).
  • Non-standard — Mozilla-specific; not on a standards track.
  • Web Workers — MDN notes it is available in workers where the engine supports it.

📝 Syntax

JavaScript
event.explicitOriginalTarget

Value

Returns the EventTarget object, or null if there isn’t one.

Safe read pattern

JavaScript
el.addEventListener("click", (event) => {
  // Portable default
  const portable = event.target;

  // Firefox-only extra detail
  const original =
    "explicitOriginalTarget" in event
      ? event.explicitOriginalTarget
      : null;

  console.log(portable, original);
});

⚡ Quick Reference

GoalCode / note
Feature-detect"explicitOriginalTarget" in event
Read (Firefox)event.explicitOriginalTarget
Describe nodeevent.explicitOriginalTarget?.nodeName
Portable choiceevent.target
MDN statusNon-standard (Mozilla-specific)

🔍 At a Glance

Four facts to remember about explicitOriginalTarget.

Type
EventTarget?

Or null

Status
non-std

Mozilla only

Focus
original

Pre-retarget

Prefer
target

Cross-browser

Examples Gallery

Examples follow MDN Event: explicitOriginalTarget. Every demo feature-detects so labs still make sense outside Firefox.

📚 Getting Started

Detect support and compare with the standard target.

Example 1 — Feature-Detect the Property

Check whether this browser exposes explicitOriginalTarget.

JavaScript
button.addEventListener("click", (event) => {
  const supported = "explicitOriginalTarget" in event;
  console.log(supported
    ? "Supported (likely Firefox)"
    : "Not available — use event.target");
});
Try It Yourself

How It Works

The in operator is the safest beginner check for optional event fields.

Example 2 — Compare with event.target

Log both values so you can see when Firefox differs.

JavaScript
box.addEventListener("click", (event) => {
  const t = event.target;
  const eot = ("explicitOriginalTarget" in event)
    ? event.explicitOriginalTarget
    : "(unsupported)";

  console.log("target:", t && t.nodeName);
  console.log("explicitOriginalTarget:", eot && eot.nodeName
    ? eot.nodeName
    : eot);
});
Try It Yourself

How It Works

On engines without the property, fall back gracefully instead of throwing.

📈 Text Nodes & Portable Fallbacks

MDN’s text-node retargeting idea and production-safe patterns.

Example 3 — Click Text Inside a Paragraph (MDN Idea)

MDN notes mouse events over text nodes may retarget to the parent. In Firefox, explicitOriginalTarget can still be the text node (#text).

JavaScript
para.addEventListener("click", (event) => {
  const lines = [
    "target: " + event.target.nodeName,
  ];
  if ("explicitOriginalTarget" in event && event.explicitOriginalTarget) {
    lines.push(
      "explicitOriginalTarget: " +
        event.explicitOriginalTarget.nodeName
    );
  } else {
    lines.push("explicitOriginalTarget: (unsupported)");
  }
  out.textContent = lines.join("\n");
});
Try It Yourself

How It Works

Exact values vary by engine. Chrome often reports P for both (property missing).

Example 4 — Describe the Original Node Safely

Inspired by MDN’s nodeName alert example, without relying on XUL.

JavaScript
function describeOriginal(event) {
  if (!("explicitOriginalTarget" in event)) {
    return "unsupported — use " + event.target.nodeName;
  }
  const node = event.explicitOriginalTarget;
  if (!node) return "null";
  return node.nodeName + " (nodeType " + node.nodeType + ")";
}

menuItem.addEventListener("click", (event) => {
  console.log(describeOriginal(event));
});
Try It Yourself

How It Works

MDN’s XUL command demo returned menuitem; here we use a normal button for the web.

Example 5 — Portable Helper with Fallback

One helper that prefers the Mozilla field when present, otherwise target.

JavaScript
function getUsefulTarget(event) {
  if (
    "explicitOriginalTarget" in event &&
    event.explicitOriginalTarget
  ) {
    return event.explicitOriginalTarget;
  }
  return event.target;
}

el.addEventListener("click", (event) => {
  const node = getUsefulTarget(event);
  console.log(node.nodeName);
});
Try It Yourself

How It Works

For production UI, most apps should just use event.target and skip the Mozilla branch.

🚀 Common Use Cases

  • Learning Firefox event retargeting (text nodes vs parent elements).
  • Reading legacy Mozilla / XUL-era demos that log nodeName.
  • Debugging Gecko-only differences next to event.target.
  • Comparing with originalTarget when studying anonymous content.
  • Teaching why standards properties beat engine-specific ones.

🔧 How It Works

1

User interacts

For example, a click lands on text inside a paragraph.

Input
2

Engine may retarget

Firefox can retarget mouse events from a text node to its parent.

Gecko
3

Standard target updates

event.target often shows the parent element after retargeting.

target
4

Mozilla field keeps original

explicitOriginalTarget can still point at the non-anonymous original (e.g. #text).

📝 Notes

  • MDN: Non-standard — show the banner; not Deprecated / Experimental on that page.
  • Mozilla-specific; not part of any current specification.
  • Available in Web Workers where the engine supports it.
  • Never contains anonymous content (unlike originalTarget).
  • Related learning: eventPhase, currentTarget, Event(), addEventListener(), JavaScript hub.

Limited / Non-standard Browser Support

Event.explicitOriginalTarget is a Mozilla-specific property. MDN marks it Non-standard and not on a standards track. Logos use the shared browser-image-sprite.png sprite. Prefer event.target for portable apps.

Non-standard · Mozilla

Event.explicitOriginalTarget

Read-only non-anonymous original EventTarget — mainly Firefox. Feature-detect; do not rely on it in production.

Limited Not for production
Google Chrome Generally not supported
Unavailable
Mozilla Firefox Supported (Gecko / Mozilla-specific)
Supported*
Apple Safari Generally not supported
Unavailable
Microsoft Edge Chromium: generally not supported
Unavailable
Opera Chromium: generally not supported
Unavailable
Internet Explorer Not a portable web API
Unavailable
explicitOriginalTarget Firefox-oriented

Bottom line: Feature-detect in Firefox experiments. For cross-browser code, use event.target (and currentTarget / composedPath as needed).

Conclusion

Event.explicitOriginalTarget is a non-standard Mozilla property for the non-anonymous original target—handy when studying Firefox retargeting, but not a replacement for event.target in portable apps.

Continue with isTrusted, currentTarget, eventPhase, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before reading the property
  • Prefer event.target in production UI
  • Compare side-by-side in Firefox when learning retargeting
  • Document that demos are Mozilla-specific
  • Use currentTarget for the listener host

❌ Don’t

  • Ship cross-browser logic that requires this field
  • Assume Chrome/Safari expose it
  • Confuse it with currentTarget
  • Skip null / unsupported checks
  • Treat XUL demos as modern web APIs

Key Takeaways

Knowledge Unlocked

Five things to remember about explicitOriginalTarget

Mozilla’s non-anonymous original target—not a web standard.

5
Core concepts
🎯02

Original

pre-retarget

Meaning
🔎03

Detect

use in

Safety
🔁04

Prefer

event.target

Portable
📚05

vs originalTarget

no anonymous

Compare

❓ Frequently Asked Questions

It is a read-only, Mozilla-specific Event property that returns the non-anonymous original EventTarget of the event (or null). MDN marks it Non-standard.
MDN marks it Non-standard only—not Deprecated or Experimental on that page. It is not part of any web specification and is not on track to become a standard. Prefer event.target for portable code.
In Firefox, some events (for example mouse events over text nodes) are retargeted to a parent element. event.target often shows that parent, while explicitOriginalTarget can still point at the original text node.
Both are Mozilla-specific. MDN says explicitOriginalTarget never contains anonymous content, while originalTarget may. Neither should be used in cross-browser production apps.
Primarily Firefox (Gecko). Chrome, Safari, and Edge generally do not expose it. Always feature-detect before reading.
For portable apps use event.target (and event.currentTarget when you need the listener host). For path inspection, consider event.composedPath() where available.
Did you know?

MDN’s classic demo used XUL <command> / <menuitem> and alerted ev.explicitOriginalTarget.nodeName (often menuitem). Modern web pages should not depend on XUL; use feature-detect demos with normal HTML instead.

Next: isTrusted

Tell user-agent events apart from dispatchEvent and element.click().

isTrusted →

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.

5 people found this page helpful