Event Bubbling

This paragraph and the button after it are enclosed in a DIV tag. The events from the button are 'bubbled' up to a DIV tag, unless they are cancelled in code.

Use the following buttons to control the bubbling:

Bubble

Don't Bubble

To see bubbling in action:

1.  Select Don't Bubble, then click the Change Color button. Only the onclick event of the button fires.

2.  Select Bubble, then click Change Color. The event bubbles up to the DIV, causing both the button and the body to change color.