Web development · The DOM and events

Listening for events

Every button that does something on a page works the same way: the script hands the browser a function to call later.