← Software Knowledge
PART II · FRONTEND & BROWSER

Event

An action or change that software can detect and respond to.

01 · What is it?

An event is something that happens in the browser or user interface.

JavaScript can detect events and run code in response.

A simple definition: an event tells software that something happened.

02 · Think of it like...

Think of an event as a signal.

Something happens. The signal is detected. Software responds.

Something Happens
Event
Software Response

03 · What does it do?

Events allow software to react to user and system actions.

Click
Input
Change
Submit
Load
Key Press

04 · Where is it used?

Events are used throughout interactive web pages.

Click a Button
Type in a Search Box
Submit a Form
Select an Option
Load a Page
Open a Menu

05 · Example

button.addEventListener("click", () => {
  console.log("Button clicked");
});
"click"
is the event.
addEventListener()
waits for the event.
The function
runs when the event happens.

06 · How it connects

User Action
Event
Event Listener
JavaScript Function
Page Update

Events connect user actions with software behavior.

07 · Do Not Confuse

Event ≠ Event Listener

Event
Something that happens.

Event Listener

Code that waits for the event.

Event = Signal·Event Listener = Listener

09 · What to Remember

An event means something happened.

JavaScript can respond to events.

Events are the foundation of interactive web pages.

Action→Event→Response
↑