Event handling
Event handling is the process of receiving events and invoking associated code to respond to them.
Secrets of the JavaScript Ninja, Second Edition
The phase of a web application's lifecycle in which the program waits for events and invokes event handlers.
- How it is used
- Defines the runtime phase that responds to events after the page has been built.
- How deep it goes
- Explains event queuing, sequential handler execution, and responsiveness, while deferring detailed performance effects.
- Examples
- Uses mousemove and click events to append messages to a list in the DOM.
- What you can do after
- Understand how browsers queue events, invoke handlers, and defer later events until the current handler finishes.
Read how Secrets of the JavaScript Ninja, Second Edition explains event handling →
Secrets of the JavaScript Ninja, Third Edition
Event handling is the process of receiving events and invoking associated handler functions to respond to them.
- How it is used
- Provides GUI interactivity by registering functions that run when browser events occur.
- How deep it goes
- Traces event processing through a queue and one-at-a-time handler execution, while deferring detailed event-loop effects.
- Examples
- Demonstrates DOMContentLoaded and keydown handlers that append event messages to a list.
- What you can do after
- Apply it via browser event listeners to make a page respond to user actions.
Read how Secrets of the JavaScript Ninja, Third Edition explains event handling →
Web Component Development with Modern Libraries and Tooling
Event handling is the association of executable code with dispatched events so that interactions can trigger behavior.
- How it is used
- Connects user interactions and component state changes to executable handlers and parent-observable events.
- How deep it goes
- Explains handler attributes, Event objects, inline expressions, and upward dispatch, but stops short of browser event internals.
- Examples
- Uses GoogleButton click handlers and a basic counter that updates count and reports change details.
- What you can do after
- Build it from scratch by attaching handlers to template elements and dispatching events when component properties change.
Read how Web Component Development with Modern Libraries and Tooling explains event handling →
What to know first
- handlerA handler is a software routine or component invoked to process an event, request, message, or other input.
- web applicationA web application is software that provides functionality through web technologies and is accessed over a network, typically through a browser or other web client.
- CSSCSS (Cascading Style Sheets) is a stylesheet language for specifying the presentation and layout of structured documents.
- eventA software event is an occurrence, state change, or notification that a system can detect, record, communicate, or handle.
Related concepts
- handleruses · A handler is a software routine or component invoked to process an event, request, message, or other input.
- callbackused by · A callback is a function or other callable supplied or registered with a component for invocation at a specified event, condition, or point in execution.
- event queueused by · An event queue is an ordered structure that buffers events until an event-handling system or consumer can process them.
- wrecused by · Wrec is a JavaScript library for creating reactive web components as standard custom elements.
- attributeconfigured by · An attribute is a named property or piece of information associated with an entity, object, or structured data item.
- single-threaded execution modelconfigured by · A single-threaded execution model runs program work on one thread of control at a time, potentially interleaving progress among tasks.
Questions about event handling
What is event handling?
Event handling is the process of receiving events and invoking associated code to respond to them.
Which Manning books explain event handling?
Secrets of the JavaScript Ninja, Second Edition, Secrets of the JavaScript Ninja, Third Edition and Web Component Development with Modern Libraries and Tooling.
What should I know before learning event handling?
Manning books that teach event handling usually introduce handler, web application, CSS and event first.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


