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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access