This question has already been answered:
There are cards with the class "advantages-content_item", when you click on them, you need to assign the class "active" to this card; The same class should be removed from the previous card when clicking on a new one.
let advitem = document.getElementsByClassName('advantages-content_item'); for (let i = 0; i < advitem.length; i++) { advitem[i].onclick = function() { for (let j = 0; j < advitem.length; j++) { advitem[j].classList.remove("active"); }; this.classList.toggle("active"); }; };