Hello I have a bunch of dynamically created div boxes with IDs div1-div999. I then grab random boxes and change the animation name to "grow". I want to also change the playstate to "running" but as I have it now just randomly selects another group to change the play states for.
else if (e.keyCode == '40') {
for(var i = 0;i <400; i++){
document.getElementById("div"+Math.floor((Math.random()*1000) + 1 )).style.animationName = "Grow";
document.getElementById("div"+Math.floor((Math.random()*1000) + 1 )).style.animationPlayState = "running";
}
}
I would like to change the animation name and play state of just one group selection. Something like:
document.getElementById("div"+Math.floor((Math.random()*1000) + 1 )).style.animationName = "Grow" / style.animationPlayState = "running";
Is there any way to do this?
Thanks!