-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
46 lines (32 loc) · 1.31 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Event: bubbles property"
short-title: bubbles
slug: Web/API/Event/bubbles
page-type: web-api-instance-property
browser-compat: api.Event.bubbles
---
{{APIRef("DOM")}}{{AvailableInWorkers}}
The **`bubbles`** read-only property of the {{domxref("Event")}} interface indicates whether the event bubbles up through the DOM tree or not.
> [!NOTE]
> See [Event bubbling](/en-US/docs/Learn/JavaScript/Building_blocks/Event_bubbling) for more information on bubbling.
## Value
A boolean value, which is `true` if the event bubbles up through the DOM tree.
## Example
```js
function handleInput(e) {
// Check whether the event bubbles passes the event along
if (!e.bubbles) {
passItOn(e);
}
// Already bubbling
doOutput(e);
}
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Event.stopPropagation", "stopPropagation()")}} to prevent further propagation of the current event in the capturing and bubbling phases
- {{domxref("Event.stopImmediatePropagation", "stopImmediatePropagation()")}} to not call any further listeners for the same event at the same level in the DOM
- {{domxref("Event.preventDefault", "preventDefault()")}} to allow propagation to continue but to disallow the browser to perform its default action should no listeners handle the event