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

Chapter 18. JavaScript and User Input > Understanding JavaScript Events

Understanding JavaScript Events

In Chapter 17, you saw numerous references to event handling. One of JavaScript’s main functions is to react to what the user does on the page, whether that’s selecting buttons, clicking hyperlinks, or even hovering over items with the mouse. Anything that the user does is considered an event, as is anything that happens automatically or that occurs within the browser. For instance, when a page loads, that’s an event. When the page is unloaded so that another page can appear, that’s an event, too.

To deal with these events, you’ll need to add event handlers to certain XHTML elements. You’ll follow this general format:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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