Answer the question
In order to leave comments, you need to log in
The code doesn't work. why?
let el = document.querySelectorALL('.thumb li');
for (let i = 0; i < el.length; i++){
el[i].onclick = function(){
var c = 0;
while (c < el.length){
el[c++].className = 'check';
}
el[i].className = 'check active';
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question