Firing Functions with Event Handlers

Chapter 10, “Event Handlers,” examines event handlers in detail. Here, however, you need to know how event handlers launch a JavaScript function. Chapter 10 explores the nuances of event handlers and the several different ones that are available in HTML and JavaScript.

Event Categories

Events can be divided into three main general categories:

  • Keyboard and mouse events

  • Load events

  • Form-related events

Errors and window resizing can also be handled as events. Trapping errors can be used both in debugging and to keep a script from crashing. However, in this chapter, all the focus is on the main categories and how an event from any one works to fire a JavaScript function.

Mouse and Keyboard Events

Setting up functions ...

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.