JavaScript/Changing element styles/Exercises

Topic: CSS style

We use the HTML page of the previous page for the exercises.

1. Modify the function.
 * If the background color of 'div_1' is green, change it to aqua; else, change it back to green.
 * If the background color of the button is red, change it to yellow; else, change it back to red.

2. Be creative. Modify the function  so that other CSS properties change, e.g., div's text size, body's padding or background color, ... .

3. Modify the function.
 * Ask the user  which background color he prefers for the first div.
 * Change the background color of the first div to this color.