9 lines
249 B
JavaScript
9 lines
249 B
JavaScript
|
const list = document.querySelectorAll('.list');
|
||
|
function activeClick(){
|
||
|
list.forEach((itme) =>
|
||
|
itme.classList.remove("active"));
|
||
|
this.classList.add("active");
|
||
|
}
|
||
|
list.forEach((item) =>
|
||
|
item.addEventListener('click', activeClick));
|