bubbles Event Attribute
Event Object
Definition and Usage
The bubbles event attribute returns a Boolean value. If the event is a bubbling type, it returns true; otherwise it returns false.
Event bubbling is divided into three phases, as follows:
- First, the capture phase. The event travels down the document tree from the Document object to the target node. If any ancestor of the target has specifically registered a capture event handler, those handlers run during event propagation.
- The second phase occurs at the target node itself. The appropriate event handlers registered directly on the target will run. This is similar to the event handling method provided by the Level 0 event model.
- Third, the bubbling phase. In this phase, the event propagates upward from the target element back, or bubbles back, to the document hierarchy of the Document object.
Syntax
event
.bubbles
Example
Example
The following example checks whether the event that occurred is a bubbling event:
Click this paragraph; if the event is a bubbling event, an alert box will pop up.
Try it »
Event Object