50projects50days/faq-collapse/script.js

7 lines
193 B
JavaScript
Raw Normal View History

2020-10-13 16:10:44 +00:00
const toggles = document.querySelectorAll('.faq-toggle')
toggles.forEach(toggle => {
toggle.addEventListener('click', () => {
toggle.parentNode.classList.toggle('active')
})
})