Skip to main content

Event Handling

Learn Event Handling (DOM & Events, JavaScript) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Handling Events addEventListener() attaches a callback that runs when a specific event (click, input, submit, etc.) fires on an element. Multiple listeners can be attached to the same event without overwriting each other (unlike the old onclick = ... style).

More lessons in DOM & Events