11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table 11-9: Behavior of Internet Explorer Events<br />

Event Handler Bubbles? Cancelable?<br />

onsubmit No Yes<br />

onunload No No<br />

You might wonder about the cancelable column in Table 11-9. <strong>The</strong> idea here is that an event<br />

that is cancelable can have its upward progress halted in script. We‘ll see how to do this in a<br />

moment, but for now to illustrate event bubbling in action, consider the following example.<br />

Handlers for clicks are defined for many objects in the hierarchy, and each writes the name of<br />

the element to which it is attached into the paragraph with id of ―results‖:<br />

<br />

<br />

<br />

Event Bubbling Example<br />

<br />

<br />

><br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!