Encyclopedia / JavaScript

Events

Signals like click, input, scroll and keydown.

Scripts listen for events and react. Long-running event handlers block the main thread, and the page feels frozen. That delay is what INP (Interaction to Next Paint) measures.

button.addEventListener('click', () => {
  panel.hidden = !panel.hidden;
});

Related terms

JavaScript Core Web Vitals

Where it shows up in a page load

  1. Step 10: JavaScript makes it interactive. Scripts run, attach event listeners and may fetch more data from an API. How quickly the page responds to a tap is INP, another Core Web Vital.

Watch the full request journey →

More in JavaScript

What happens when someone clicks, types or scrolls.

JavaScript fetch() Framework Rendering: SSG, SSR, CSR

Open in the interactive encyclopedia →