I want to set a variable in a class name

let box = document.querySelector("#app > div:nth-child(`${i}`) > div:nth-child(5)");

let numbers = 80;

for(var i = 50; i < numbers; i++) {
   box.innerText = "1.5";
}

How can I keep the number here constantly increasing? I tried $ {} failed

( div:nth-child(`${i}`) )

I want to take the class of the boxes and change the text in the box one by one

29 thoughts on “I want to set a variable in a class name”

Leave a Comment