Web APIs

Event.bubbles

Try the free JavaScript compiler

Reports whether an event participates in the ancestor bubbling phase.

Formal Syntax & Structure

javascript syntaxjavascript
event.bubbles

Return Value

boolean

Whether event bubbles.

Working Example

Example Snippetjavascript
const p=document.createElement("div"),b=document.createElement("button");p.append(b);p.addEventListener("demo",()=>console.log("capture"),true);p.addEventListener("demo",()=>console.log("bubble"));b.dispatchEvent(new Event("demo"));
JavaScript Reference