JavaScript Event bubbles Property

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Baseline Widely available
Instance property

What You’ll Learn

The bubbles property is a read-only boolean on every Event: true if the event bubbles up the DOM tree, false if it does not. Learn how to read it, set it on synthetic events, see parent listeners fire, and relate it to stopPropagation—with five examples and try-it labs.

01

Kind

Instance property

02

Type

boolean (read-only)

03

Means

Bubbles up DOM?

04

Set via

Constructor options

05

Workers

Yes

06

Status

Baseline widely

Introduction

After an event reaches its target, some events continue upward through ancestors—that is bubbling. event.bubbles tells you whether this event participates in that upward trip.

You cannot assign to event.bubbles. For synthetic events, pass { bubbles: true } (or false) to new Event() (or a subclass). Built-in events get their value from the browser’s event definition.

💡
Beginner tip

A parent listener only hears a child’s event during bubbling if event.bubbles is true (and nothing called stopPropagation()). Non-bubbling events stay on the target unless you use capturing listeners.

Understanding Event.bubbles

An instance property that answers: “After the target phase, will this event travel up the ancestor chain?”

  • Valuetrue if it bubbles; false otherwise.
  • Read-only — set only at construction time for synthetic events.
  • Propagation — bubbling can be stopped with stopPropagation().
  • Not the same as cancelablecancelable controls preventDefault(), not tree travel.
  • Baseline Widely available on MDN (since July 2015); also in Web Workers.

📝 Syntax

JavaScript
event.bubbles

Value

A boolean: true if the event bubbles up through the DOM tree.

Set on synthetic events

JavaScript
const bubbling = new Event("look", { bubbles: true });
const local = new Event("look", { bubbles: false }); // default

console.log(bubbling.bubbles); // true
console.log(local.bubbles);    // false

⚡ Quick Reference

GoalCode / note
Readevent.bubbles
Create bubbling eventnew Event("x", { bubbles: true })
Default for new Eventbubbles: false
Stop upward travelevent.stopPropagation()
MDN statusBaseline Widely available (since July 2015)

🔍 At a Glance

Four facts to remember about Event.bubbles.

Type
boolean

Read-only

true means
goes up

DOM ancestors

Set how?
options

At construction

Baseline
widely

Since July 2015

Examples Gallery

Examples follow MDN Event: bubbles. Use View Output or Try It Yourself.

📚 Getting Started

Read the flag and set it on synthetic events.

Example 1 — Read bubbles on a Click

Clicks bubble—log the property when the user clicks.

JavaScript
document.getElementById("btn").addEventListener("click", (event) => {
  console.log("bubbles =", event.bubbles); // true for click
});
Try It Yourself

How It Works

Built-in click events are defined to bubble, so event.bubbles is true.

Example 2 — bubbles: true vs Default

Compare two synthetic events with different options.

JavaScript
const a = new Event("look"); // default bubbles: false
const b = new Event("look", { bubbles: true });

console.log(a.bubbles); // false
console.log(b.bubbles); // true
Try It Yourself

How It Works

The property is fixed when the event is constructed; you cannot flip it later.

📈 Bubbling in the Tree

See parents receive events, MDN’s check pattern, and stopPropagation.

Example 3 — Parent Hears a Bubbling Child Event

Dispatch with bubbles: true so the parent listener runs.

JavaScript
const parent = document.getElementById("parent");
const child = document.getElementById("child");
const out = document.getElementById("out");

parent.addEventListener("ping", () => {
  out.textContent = "parent heard ping (bubbled)";
});

child.dispatchEvent(new Event("ping", { bubbles: true }));
// With { bubbles: false }, the parent would not hear it.
Try It Yourself

How It Works

The event starts at child, then bubbles to parent because bubbles is true.

Example 4 — Check bubbles Before Passing On (MDN)

MDN-style: if the event is not bubbling, manually pass it along.

JavaScript
function passItOn(e) {
  console.log("manually passing", e.type);
}

function doOutput(e) {
  console.log("output for", e.type, "bubbles=" + e.bubbles);
}

function handleInput(e) {
  // Check whether the event bubbles; pass the event along if not
  if (!e.bubbles) {
    passItOn(e);
  }
  // Already bubbling (or after manual pass)
  doOutput(e);
}

handleInput(new Event("input-like", { bubbles: false }));
handleInput(new Event("click-like", { bubbles: true }));
Try It Yourself

How It Works

Reading e.bubbles lets your code branch when an event will not travel to ancestors on its own.

Example 5 — stopPropagation Blocks the Parent

Even when bubbles is true, you can stop upward travel.

JavaScript
const parent = document.getElementById("parent");
const child = document.getElementById("child");
const out = document.getElementById("out");
const log = [];

parent.addEventListener("ping", () => log.push("parent"));
child.addEventListener("ping", (e) => {
  log.push("child");
  e.stopPropagation(); // parent will not run
});

child.dispatchEvent(new Event("ping", { bubbles: true }));
out.textContent = log.join(" → "); // "child"
Try It Yourself

How It Works

bubbles says the event can bubble; stopPropagation() says it must not continue for this dispatch.

🚀 Common Use Cases

  • Event delegation: one parent listener for many bubbling child events.
  • Choosing { bubbles: true } on custom app events so layouts can react.
  • Detecting whether a received event will reach outer handlers.
  • Teaching / debugging propagation with logs of bubbles and eventPhase.
  • Pairing with stopPropagation when a component must own an interaction.

🔧 How It Works

1

Event is created

Browser or new Event(type, { bubbles }) sets the flag.

Setup
2

Target phase

Listeners on the target run first.

Target
3

If bubbles is true

Event travels up ancestors (unless stopped).

Bubble
4

Handlers react

Parents can handle delegated events; read event.bubbles anytime.

📝 Notes

  • MDN: Baseline Widely available (since July 2015) — no Deprecated / Experimental / Non-standard banner.
  • Available in Web Workers.
  • Read-only—set via constructor options for synthetic events.
  • preventDefault() does not stop bubbling; use stopPropagation().
  • Related learning: Event(), dispatchEvent(), addEventListener(), MouseEvent(), JavaScript hub.

Universal Browser Support

Event.bubbles is marked Baseline Widely available on MDN (since July 2015). Logos use the shared browser-image-sprite.png sprite from this project. It is also available in Web Workers.

Baseline · Widely available

Event.bubbles

Read-only boolean: true if the event bubbles up the DOM tree after the target phase.

Universal Widely available
Google Chrome Full support · Desktop & Mobile
Full support
Mozilla Firefox Full support · Desktop & Mobile
Full support
Apple Safari Full support · macOS & iOS
Full support
Microsoft Edge Full support · Chromium
Full support
Opera Full support · Modern versions
Full support
Internet Explorer Supported (legacy)
Full support
Event.bubbles Excellent

Bottom line: Read event.bubbles to know if ancestors will see the event. Set bubbles only when constructing synthetic events.

Conclusion

Event.bubbles is the simple yes/no for upward DOM propagation. Read it on any event; set it only when you construct a synthetic one with { bubbles: true }.

Continue with cancelable, Event(), dispatchEvent(), or the JavaScript hub.

💡 Best Practices

✅ Do

  • Use bubbling + delegation for many similar children
  • Pass { bubbles: true } when parents must hear custom events
  • Read event.bubbles when debugging missing parent handlers
  • Call stopPropagation() only when a component must own the event
  • Learn cancelable and composed as separate flags

❌ Don’t

  • Try to assign event.bubbles = true after creation
  • Assume every event type bubbles
  • Confuse preventDefault with stopping propagation
  • Forget that default new Event() uses bubbles: false
  • Overuse stopPropagation—it breaks outer listeners

Key Takeaways

Knowledge Unlocked

Five things to remember about bubbles

Read-only flag for upward DOM travel.

5
Core concepts
📈02

true

goes to parents

Meaning
📝03

Set once

constructor options

Create
🛑04

stopPropagation

can still block

Control
🎯05

Baseline

since Jul 2015

Status

❓ Frequently Asked Questions

It is a read-only boolean on an Event. It is true if that event bubbles up through the DOM tree after the target phase, and false if it does not.
No. MDN marks Event.bubbles as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard. It is also available in Web Workers.
No. bubbles is read-only. Set it when you create a synthetic event with new Event(type, { bubbles: true }) or a subclass constructor. Built-in events get their bubbling behavior from the browser.
No. Many do (for example click, input), but some do not (for example focus and blur in the classic model, and Element scroll). Always check event.bubbles or the event docs for that type.
Call event.stopPropagation() to stop further capturing/bubbling. Call event.stopImmediatePropagation() to also skip remaining listeners on the same target. preventDefault() does not stop propagation by itself.
Use new Event("my-event", { bubbles: true }) (and cancelable if needed), then target.dispatchEvent(event). Parent listeners will receive it during the bubble phase if they listen for that type.
Did you know?

Event delegation (one listener on a parent for many children) only works for events that bubble—or for listeners registered in the capture phase. Checking event.bubbles is a quick sanity check when a parent never seems to hear a child.

Next: cancelable

Learn when preventDefault can cancel an event.

cancelable →

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