Web APIs
Event.bubbles
Reports whether an event participates in the ancestor bubbling phase.
Formal Syntax & Structure
javascript syntaxjavascript
event.bubblesReturn 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"));