In-class exercise for JS event listeners
Clone or download
Pull request Compare This branch is 1 commit behind dc-wdi-fundamentals:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
index.html
readme.md
script.js
style.css

readme.md

Implement an Event Listener

We've provided you with three files: index.html style.css and script.js.

Inside of index.html, you'll find two buttons, one that should turn the background to red and a second that should turn the background to blue. Write the necessary JavaScript to implement an event for each button.

You have been provided with two functions -- changeBackgroundColorToBlue and changeBackgroundColorToWhite -- that can be used as callbacks. You do not need to change the content of these functions.

When you're done, it should display this functionality.

Bonus:

If you finish early, see if you can implement it so that the background color changes when the user hovers over one of the buttons.