Section 2.4. Events


2.4. Events

Objects that can receive events have events listed in their main entries. In a change from previous editions of this book, events are listed by their event typethe version without the leading "on" prefix. When you choose to bind an event handler function to an object via its event property, use the "on" prefix format, as described in "Binding Event Handlers to Elements" in Online Section VI.

The selection of events listed for each object is based on a couple of factors. First, just as most HTML 4.0 elements have intrinsic events associated with them, those same events are listed in this chapter with the objects that reflect the HTML element. As such, it may seem odd that an element that has almost no visual presence on a page has keyboard and mouse events. Those events are listed just the same, even though the likelihood of your scripting them is next to nil.

Second, the Internet Explorer and W3C DOM event bubbling models (see Online Section VI) dictate that it is possible for an event from one element to bubble up through the element containment hierarchy all the way to a root node or element. This means that essentially every event that can appear in the most nested element is also available in all elements higher up the containment chain. In other words, virtually every element that acts as a container can have virtually every bubbling event type associated with it. You can read more about the characteristics of each event type in Chapter 3.




Dynamic HTML. The Definitive Reference
Dynamic HTML: The Definitive Reference
ISBN: 0596527403
EAN: 2147483647
Year: 2004
Pages: 120
Authors: Danny Goodman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net