HOUR 9:Responding to Events

What You’ll Learn in This Hour:

• How event handlers work

• How event handlers relate to objects

• Creating an event handler

• Testing an event handler

• Detecting mouse actions

• Detecting keyboard actions

• Intercepting events with a special handler

• Adding friendly link descriptions to a web page

In your experience with JavaScript so far, most of the scripts you’ve written have executed in a calm, orderly fashion, moving from the first statement to the last.

In this hour, you’ll learn to use the wide variety of event handlers supported by JavaScript. Rather than executing in order, scripts using event handlers can interact directly with the user. You’ll use event handlers in just about every script ...

Get Sams Teach Yourself JavaScript in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.