events
DOM events (overview)
Common event types you listen for from scripts—names align with `addEventListener`.
These names appear with addEventListener('click', …) and inline handler attributes like onclick (prefer listeners over inline handlers in applications).
| Event family | Examples | Typical use |
|---|---|---|
| User input | input, change, submit | Forms and controls. |
| Pointer | click, dblclick, contextmenu | Buttons, toggles (keyboard parity required). |
| Pointer motion | pointerdown, pointermove, pointerup | Unified pointer/touch model. |
| Keyboard | keydown, keyup | Shortcuts and accessible activation. |
| Focus | focus, blur, focusin, focusout | Visibility of keyboard focus rings. |
| Document | DOMContentLoaded, load | Initialization timing. |
| Clipboard | copy, cut, paste | Needs permission / secure context patterns. |
| Drag & drop | dragstart, dragover, drop | Offer keyboard alternatives. |
| Media | play, pause, ended, error | Audio/video lifecycle. |