Events in Javascript
Introduction
- Events are actions that happen in the system
- The system tells you about so you can respond to them in some way if desired
- For example, if the user selects a button on a webpage, you might want to respond to that action by displaying an information box
- Each available event has an event handler, which is a block of code
- Event handlers are sometimes called event listeners
Event handler
- Any function or object that is registered to be notified of events
- Event listeners can be registered with on attributes in HTML
- Event listeners can be registered with properties in Web APIs