100-project-100-days-website/100_projects/93-expanding-cards/script.js
2023-05-26 13:15:09 +03:00
Ask

14 lines
313 B
JavaScript

{68d6b5c33d836cca88b676d5811c8d0524b2635c true 313 script.js 0xc002d7cee0}

const panels = document.querySelectorAll('.panel')
panels.forEach(panel => {
panel.addEventListener('click', () => {
removeActiveClasses()
panel.classList.add('active')
})
})
function removeActiveClasses() {
panels.forEach(panel => {
panel.classList.remove('active')
})
}