OK let's head back to the JS Tab and copy our work from earlier, then paste it and change the names of our variable, the class and the variable again to add a new Variable and EventListener to each box in our HTML.
Now let's pause and consider how sustainable this process is. Our end goal is have 300 Boxes. Do you think you could do that without getting bored or tired? How big would the file get as well? This is why the DRY principle is important. DRY stands for Don't Repeat Yourself. Obviously Adding a new variable and a new EventListener to every Box would violate that principle. I have another plan that will get rid of all these repeating statements. Using a container for our boxes and making them with a loop!
Let's head back to the HTML pane for the last time, and remove the two additional boxes. Then make a new "div" tag with a class of "box-container" add your original "div" with the "box" class inside of the container by placing it inside the two tags.
Let's remove the remnants of Box2 and Box3 from the CSS pane. As well as adding a cool Transition effect. We'll start with "-webkit-transition: 1s all;".
OK let's head back the JS and remove all the excess variables and Event Listeners. Then we need to change the remaining Box Variable and EventListener. Instead of adding an Event Listener to the box we will add it to a new variable called "boxContainer". That way when we add items to the container, they will all already have a listener. Make sure to change the variable name, and the name of the class in the ".querySelector()" method. Try out the result it should work again.