DJ JS

DJ JS

You're starting your business as a strictly online DJ (DJ JS) and you want to start by creating a website where people can change the color of a square on the page by interacting with different HTML Events.

The square's color will change as follows:

  • Blue when the mouse hovers over the square
  • Red when the mouse button is held down over the square
  • Yellow when the mouse button is let go over the square
  • Green when the mouse is double clicked in the square
  • Orange when the mouse scroll is used somewhere in the window (not just over the square).

You should also be able to press the first letter of the colors (typing "r" on the keyboard for "red", for example) and have the box change to that color. Check this site for a full list of keyboard key codes.

Attempt these requirements. If you become discouraged, included are things to consider.

Take a minute to think through how you would implement all of these event listeners.

You will need a different even for each event.
Key press like events are special, in that any key will trigger the event.

.addEventListener will be called on your square 6 times.