50projects50days/faq-collapse/script.js
2020-10-13 12:10:44 -04:00

7 lines
193 B
JavaScript

const toggles = document.querySelectorAll('.faq-toggle')
toggles.forEach(toggle => {
toggle.addEventListener('click', () => {
toggle.parentNode.classList.toggle('active')
})
})