6 Processing and Triggering Events
An important concept in JavaScript programming is events and thus event-driven programming. In this chapter, we’ll show you the principle behind events and how you can use event-driven programming to react to events triggered by users within a (web) application.
When you visit a web page and perform some actions, various events are triggered in the background. For example, when the page is fully loaded; when the user enters text into a text field, selects an option from a select box, or clicks on a button; or when elements enter or leave the visible area of the screen. Within your JavaScript code, you have the possibility to react to these events. For example, you could validate the text that the user has entered ...
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