bubbles Event Property - Javascript DOM

Javascript examples for DOM:Event

Description

The Bubbles event property returns a Boolean value telling if an event is a bubbling event.

Event is bubbling from triggered element to its parent until it is handled, or reaches the document object.

Return Value

A Boolean, indicating whether the specified event is a bubbling event.

The following code shows how to find out if a specific event can bubble.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<button onclick="myFunction(event)">Test</button>

<p id="demo"></p>

<script>
function myFunction(event) {//from   ww w. ja  v a2 s  .  co  m
    var x = event.bubbles;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials