Events are things that happen
A click. A key press. A form submit. The page finishing load. Your code does not run in a straight line waiting for these. It registers a function and the browser calls it later.
const btn = document.querySelector("#save");
btn.addEventListener("click", function () {
console.log("Button was clicked");
});
The second argument is a callback: a function you hand over for someone else to call. That idea appears everywhere in JavaScript.
Common event names: click, input, change, submit, keydown, mouseenter, DOMContentLoaded.