changeBackground
Note where the changeBackground
function is situated in the
JavaScript file. Use yours to make the backgrounds of the three boxes change
(in order) to red, green, and blue whhen clicked and to revert to white when
exited.
Code Challenge Can you get rid of the IDs for the three
boxes and refactor your code to eliminate duplication? How can you use
document.querySelectorAll
to grab all of the div elements at once?
Or can you change them to having a class and accomplish the same thing?