That's my first question here so please don't hate me :) Tried to look for it but I wasn't able to find what I need. How can I print index of div with class .circle that has been clicked? Here's my code
var circle = document.querySelectorAll(".circle");
for(i=0; i<circle.length; i++){
circle[i].addEventListener("click", function(){
this.classList.toggle("hide");
console.log(circle.indexOf(this));
})
}
Thanks!