document.addEventListener('DOMContentLoaded', function() { var teamBlocksItems = document.querySelectorAll('.team-blocks-item-new'); teamBlocksItems.forEach(function(item) { item.addEventListener('click', function() { // Reset all other items teamBlocksItems.forEach(function(innerItem) { innerItem.classList.remove('-active-new'); }); // Activate the clicked item item.classList.add('-active-new'); }); }); });