Latest web development tutorials

bubbles event properties

Event Object Reference Event objects

Definition and Usage

bubbles property returns a Boolean value that event, if the event is a bubbling type, returns true, otherwise fasle.

Event bubbling divided into three stages, it is this:

  • First, the capture phase. Document from the event object is passed down the document tree to the destination node. If any one of the ancestors of the target capture specially registered event handlers, then run these handles in the event propagation.
  • The second stage occurs in the destination node itself. Direct hit for registered event handler will run on the target. This event handler method with 0 event model provides similar.
  • Third, the bubble stage. At this stage, the event spread upward from the target element or blistering return back to the document level Document object.

grammar

event .bubbles


Examples

Examples

The following example detects whether the event is a bubbling event:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function myFunction(e){
    alert(e.bubbles);
}
</script>
</head>
<body>

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

</body>
</html>

try it"


Event Object Reference Event objects