w3schools    w3Schools
Search :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
HTML DOM
DOM HOME
DOM Intro
DOM Nodes
DOM Node Tree
DOM Methods
DOM Node Access
DOM Node Info
DOM How To
DOM Events
DOM Reference
DOM Summary

DOM Examples
DOM Examples

DOM Objects
DOM Window
DOM Navigator
DOM Screen
DOM History
DOM Location

DOM Document

DOM Anchor
DOM Area
DOM Base
DOM Body
DOM Button
DOM Event
DOM Form
DOM Frame
DOM Frameset
DOM IFrame
DOM Image
DOM Input Button
DOM Input Checkbox
DOM Input File
DOM Input Hidden
DOM Input Password
DOM Input Radio
DOM Input Reset
DOM Input Submit
DOM Input Text
DOM Link
DOM Meta
DOM Object
DOM Option
DOM Select
DOM Style
DOM Table
DOM TableCell
DOM TableRow
DOM Textarea

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

Browse Tutorials
 

bubbles Event Attribute


Event Object Reference Complete Event Object Reference

Definition and Usage

The bubbles event attribute returns a Boolean value that indicates whether or not the event is a bubbling event.

Event bubbling directs an event to its intended target, it works like this:

  • A button is clicked and the event is directed to the button
  • If an event handler is set for that object, the event is triggered
  • If no event handler is set for that object, the event bubbles up (like a bubble in water) to the objects parent

The event bubbles up from parent to parent until it is handled, or until it reaches the document object.

Syntax

event.bubbles
 

Example

The following example checks if the triggered event is a bubbling event:

<html>
<head>
<script type="text/javascript">
function getEventType(event)
  { 
  alert(event.bubbles);
  }
</script>
</head>
<body onmousedown="getEventType(event)">
<p>Click somewhere in the document. 
An alert box will tell if the 
event is a bubbling event.</p>
</body>
</html>


Try-It-Yourself Demos

Check if an event is a bubbling event


Event Object Reference Complete Event Object Reference