O'Reilly logo

JavaScript: Visual QuickStart Guide, Eighth Edition by Dori Smith, Tom Negrino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8. Handling Events

In This Chapter

Handling Window Events 196

Mouse Event Handling 204

Form Event Handling 212

Key Event Handling 216

Events are actions that the user performs while visiting your page. When the browser detects an event, such as a mouse click or a key press, it can trigger JavaScript objects associated with that event, called event handlers. In most of the previous chapters in this book, you’ve seen examples of how event handlers are used. But event handling is such an important technique to understand—and it encompasses virtually all of your pages’ interaction with the user—that it deserves its own chapter.

In this chapter, you’ll see how to use event handlers to work with windows, capture mouse movements and clicks, deal with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required