O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

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

Controlling Events

An important aspect of handling JavaScript is the ability to control the event behavior. The following list describes the event process that happens when a user interacts with the web page or browser window.

1. Physical event happens—A physical event occurs. For example, a user clicks or moves the mouse or presses a key.

2. Events are triggered in the browser—The user interaction results in events being triggered by the web browser. Often, multiple events are triggered at the same time. For example, when a user presses a key on the keyboard, three events are triggered: keypressed, keydown, and keyup.

3. Browser creates an object for the event—The web browser creates a separate object for each event that is triggered. The objects ...

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