need to reference 5 boxes for my JS script soo I add them using querySelector like soo:
var box0 = document.querySelector(".box1");
var box1 = document.querySelector(".box2");
var box2 = document.querySelector(".box3");
var box3 = document.querySelector(".box4");
var box4 = document.querySelector(".box5");
It works but I was wondering it it was possible to use a loop that would concatenate an i variable to "box" for each cicle using toString() maybe..
I have no idea how it would work but what I want is this:
for(i=0;i<5;i++){
var "box + i" = ... (".box + i")
}