GAME DEV 2026 · JAVASCRIPT FUNDAMENTALS

t1a10 — Events by Innes

HTML events are signals that happen when a visitor interacts with a page. JavaScript can respond to clicks, mouse movement, focus, keyboard input, and changes to form controls.

Reference: HTML event handlers

Example: click to display input

...

Hover over this bold text to change it.

Mouse over and mouse out events change the text above.

Try ten event examples

Each interaction writes its result to the shared event output below.

1. Double click

2. Mouse down

3. Mouse up

4. Mouse move

Move your mouse here

5. Focus

6. Blur

7. Change

8. Key down

9. Key up

10. Input

11. Submit and 12. Pointer events

Click or tap this area (pointerdown event).

The submit event can intercept a form before it reloads the page. Pointer events work with mouse, pen, and touch input.

Event output

Events will appear here!

Challenge: Combine events

Create a button that changes its text on mouseover, restores it on mouseout, and reports a click using click. Try adding a keyboard event too.