Events and Event Handlers in HTML and JavaScript

Throughout the book, and especially in this chapter, you have seen examples of different event handlers, and by now you should have an idea of what they do. To complete your understanding of what events are, how they are triggered, and what you can do with them, this chapter breaks them down into four different categories:

  • Mouse events

  • Key events

  • Form events

  • Page/window/image events

Some events and event handlers are different in the two major browsers. As with the other topics in this book, the focus will be on those features of JavaScript that have cross-browser compatibility. Likewise, some of the events deal with certain elements in HTML, to the extent that much of the discussion of those events ...

Get JavaScript Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.