There are hundreds of event types, but you'll use a small handful constantly:
| Event | Fires when... | Typical use |
|---|---|---|
click | An element is clicked (or tapped) | Buttons, links, anything clickable |
dblclick | An element is double-clicked | Editing items |
mouseenter / mouseleave | The mouse moves onto / off an element | Hover effects, tooltips |
input | The value of a text box changes (every keystroke) | Live search, character counters |
change | A dropdown, checkbox or input is changed and committed | Settings, filters |
submit | A form is submitted | Login forms, sign-ups |
keydown | A key is pressed | Keyboard shortcuts, games |
scroll | The page or element is scrolled | "Back to top" buttons, animations |
DOMContentLoaded | The HTML has finished loading | Starting your code when the page is ready |