Browser events

Before we dig into how events work in Lightning Components, it is important to briefly touch on JavaScript fundamentals in browser events. In this section, we will explore the bubbling and capturing phases in browser events.

Browser events are signals that are fired on actions (such as page loads, button clicks, key presses, and form submissions). The full list of events supported by browsers can be viewed in the Mozilla developer docs, at https://developer.mozilla.org/en-US/docs/Web/Events.

JavaScript provides various ways to attach event handlers. Some of them are as follows:

  • Event handler attributes can be attached with an HTML DOM element. Event handler attributes on DOM elements can consist of HTML events, such as onClick ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.