const accordions = document.querySelectorAll('.accordion__card');
for (const accordion of accordions) {
const title = accordion.querySelector('.accordion__card__title');
const text = accordion.querySelector('.accordion__card__text');
title.addEventListener('click', () => {
if (text.classList.contains('accordion__card__text--active')) {
text.classList.remove('accordion__card__text--active');
} else {
for (const accordion of accordions) {
const text = accordion.querySelector('.accordion__card__text');
text.classList.remove('accordion__card__text--active');
}
text.classList.add('accordion__card__text--active');
}
});
}