JavaScript Event originalTarget Property

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

What You’ll Learn

The originalTarget property is a read-only, non-standard Mozilla Event field for the original target before retargeting. Unlike explicitOriginalTarget, it can also be native anonymous content. Learn feature detection and portable alternatives—with five examples and try-it labs.

01

Kind

Instance property

02

Type

EventTarget

03

Status

Non-standard

04

Engine

Mainly Firefox

05

vs EOT

May be anonymous

06

Portable alt

event.target

Introduction

In everyday web apps you use event.target. Firefox (Gecko) sometimes retargets events—for example when interacting with internal “anonymous” content that implements form controls or other widgets.

originalTarget is Mozilla’s way to still see the original target before that retargeting. It is useful for understanding Firefox internals alongside explicitOriginalTarget—not for cross-browser production apps.

💡
Beginner tip

Always gate reads with "originalTarget" in event. On Chrome/Safari/Edge the property is usually missing. Prefer event.target for portable code.

Understanding Event.originalTarget

An instance property that returns the original target of the event before any retargetings.

  • Read-only — you inspect it; you do not assign to it.
  • Pre-retarget — keeps the original before Firefox retargeting rules apply.
  • Anonymous content — unlike explicitOriginalTarget, it can be native 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.originalTarget

Value

The original EventTarget before retargeting (Mozilla). Exact object identity is engine-specific.

Safe read pattern

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

  const original =
    "originalTarget" in event ? event.originalTarget : null;

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

⚡ Quick Reference

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

🔍 At a Glance

Four facts to remember about originalTarget.

Type
EventTarget

Pre-retarget

Status
non-std

Mozilla only

Anonymous?
possible

Unlike EOT

Prefer
target

Cross-browser

Examples Gallery

Examples follow MDN Event: originalTarget. 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 originalTarget.

JavaScript
button.addEventListener("click", (event) => {
  const supported = "originalTarget" 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 ot = ("originalTarget" in event)
    ? event.originalTarget
    : "(unsupported)";

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

How It Works

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

📈 Sibling Properties & Fallbacks

Compare with explicitOriginalTarget and keep demos portable.

Example 3 — target vs Both Mozilla Fields

Log the trio when Firefox exposes both non-standard properties.

JavaScript
function nameOf(node) {
  return node && node.nodeName ? node.nodeName : String(node);
}

para.addEventListener("click", (event) => {
  const lines = ["target: " + nameOf(event.target)];

  lines.push(
    "originalTarget: " +
      ("originalTarget" in event
        ? nameOf(event.originalTarget)
        : "(unsupported)")
  );
  lines.push(
    "explicitOriginalTarget: " +
      ("explicitOriginalTarget" in event
        ? nameOf(event.explicitOriginalTarget)
        : "(unsupported)")
  );

  out.textContent = lines.join("\n");
});
Try It Yourself

How It Works

MDN: originalTarget may include anonymous content; explicitOriginalTarget never does.

Example 4 — Describe the Original Node Safely

Print nodeName / nodeType when the field exists.

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

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

How It Works

Same safe pattern as the explicitOriginalTarget tutorial—always handle missing support.

Example 5 — Portable Helper with Fallback

Prefer originalTarget when present; otherwise use event.target.

JavaScript
function getUsefulTarget(event) {
  if ("originalTarget" in event && event.originalTarget) {
    return event.originalTarget;
  }
  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 retargeting and anonymous content.
  • Comparing with explicitOriginalTarget in Gecko debugging.
  • Reading legacy Mozilla docs that mention the original target.
  • Teaching why standards properties beat engine-specific ones.
  • Side-by-side labs with event.target in Firefox DevTools.

🔧 How It Works

1

User interacts

A click (or other event) starts on some internal or DOM node.

Input
2

Gecko may retarget

Firefox can retarget away from anonymous / original nodes.

Engine
3

Standard target updates

event.target reflects the post-retarget target.

target
4

originalTarget keeps original

Mozilla field can still point at the pre-retarget node (including anonymous content).

📝 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.
  • Can be native anonymous content (unlike explicitOriginalTarget).
  • Related learning: explicitOriginalTarget, isTrusted, currentTarget, Event(), JavaScript hub.

Limited / Non-standard Browser Support

Event.originalTarget 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.originalTarget

Read-only original EventTarget before retargeting — mainly Firefox. May include anonymous content. 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
originalTarget Firefox-oriented

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

Conclusion

Event.originalTarget is a non-standard Mozilla property for the original target before retargeting—including cases with anonymous content. Learn it next to explicitOriginalTarget, but ship with event.target.

Continue with returnValue, explicitOriginalTarget, isTrusted, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before reading the property
  • Prefer event.target in production UI
  • Compare with explicitOriginalTarget in Firefox labs
  • 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 unsupported checks
  • Treat anonymous-content details as portable web API

Key Takeaways

Knowledge Unlocked

Five things to remember about originalTarget

Mozilla’s pre-retarget original—may include anonymous content.

5
Core concepts
🎯02

Original

pre-retarget

Meaning
🛡️03

Anonymous

possible

vs EOT
🔎04

Detect

use in

Safety
🔁05

Prefer

event.target

Portable

❓ Frequently Asked Questions

It is a read-only, Mozilla-specific Event property that returns the original target of the event before any retargetings. 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.
Both are Mozilla-specific. MDN says originalTarget can also be native anonymous content, while explicitOriginalTarget never contains anonymous content.
event.target is the standard target after the engine’s retargeting rules. originalTarget aims to keep the pre-retarget original in Firefox, including cases that involve anonymous content.
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?

“Native anonymous content” is Firefox’s internal implementation detail for some widgets (parts of the UI that are not normal DOM nodes you authored). That is why originalTarget can differ from explicitOriginalTarget—and why neither is a portable web API.

Next: returnValue

Learn the deprecated cancel flag and migrate to preventDefault.

returnValue →

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