Bubbles event properties

bubbles case attribute The event object

Definitions and usages

The bubbles event property returns a Boolean value, or true if the event is a blistering type, otherwise fasle is returned.

Event bubbling is divided into three stages, and it is like this:

  • First, the capture phase. E vents are passed down the document tree from the Document object to the target node. If any of the target's ancestors specifically registered capture event handles, run them during event propagation.
  • The second phase occurs at the target node itself. T he appropriate event handle on the direct registration hit target will run. This is similar to the event handling method provided by the Level 0 event model.
  • Third, the foaming phase. At this stage, the event propagates up from the target element or bubbles back to the document level of the Document object.

Grammar

event .bubbles


The following example detects whether the event that occurred was a blistering event:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool在线教程(w3cschool.cn)</title>
<script>
function myFunction(e){
alert(e.bubbles);
}
</script>
</head>
<body>

<p onclick="myFunction(event)">点击这个段落, 如果事件是一个冒泡事件将弹出警告框提示。</p>

</body>
</html>

Try it out . . .


bubbles case attribute The event object