Examples of event handling in JavaScript.
To run the examples, you need a local development server. It needs to access JavaScript modules which don't serve when accessing the .html
via the file
protocol.
- Toggle colors Trivial example that toggles the background color of a div between blue and red
- Toggle visibility toggles visibility of an object.