• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Handling Events > Using the JavaScript Events

Using the JavaScript Events

As you'll see in many places throughout the rest of the book, each JavaScript object has its own collection of properties and methods, many of which are unique to that object. For example, the Select object—a <select> list in a form—has an options property that refers to the various items in the list. No other JavaScript object has such a property. As a result, the full JavaScript object model contains dozens of properties and methods.

Events, however, are different. Very few are unique to a single object, and most are associated with half a dozen objects or more. This makes sense when you consider the fact that most events are fired via actions that have broad use. The Click event, for example, is fired when the user clicks the mouse, but just think of all the things that can be clicked: the page, a link, a checkbox, a radio button, a form button, and more. This means that JavaScript has a relatively small collection of events in its arsenal—in the latest version of JavaScript, there are 21 in total. (I'm ignoring a Netscape event called DragDrop that requires special "signed" scripts.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint