// FAQ Accordion document.addEventListener(‘DOMContentLoaded’, function() { const faqButtons = document.querySelectorAll(‘.grip-faq-question’); faqButtons.forEach(function(button) { button.addEventListener(‘click’, function() { const isExpanded = this.getAttribute(‘aria-expanded’) === ’true’; const answer = this.nextElementSibling; const icon = this.querySelector(‘.grip-faq-icon’); // Close all other FAQ items faqButtons.forEach(function(otherBtn) { if (otherBtn !== button) { otherBtn.setAttribute(‘aria-expanded’, ‘false’); otherBtn.nextElementSibling.hidden = true; const otherIcon = otherBtn.querySelector(‘.grip-faq-icon’); if (otherIcon) otherIcon.textContent = ‘+’; } }); // Toggle current item this.setAttribute(‘aria-expanded’, !isExpanded); answer.hidden = isExpanded; if (icon) icon.textContent = isExpanded ? ‘+’ : ‘−’; }); }); });

Scroll naar boven