JavaScript/Handling DOM events/Exercises

Topic: Event handling

We use the following HTML page for the exercises.

1. Implement a 'click' event handler that toggles the 'A' area between the background colors 'silver' and 'gold'.

2. Implement a 'mouseover' event handler. With each mouse movement on the 'B' area its background color changes from "blue" to "lime", "red", "yellow", "green", and back to "blue".

3. Implement two event handlers for the 'C' area, 'mouseenter' and 'mouseleave'. When the mouse pointer enters the area, its background color changes to "red"; when it leaves the area, its background color changes to "green".

4. Bring the above 3 solutions together. We will have a page that reacts on 4 different event types.