diff --git a/script.js b/script.js new file mode 100644 index 0000000..211e751 --- /dev/null +++ b/script.js @@ -0,0 +1,12 @@ +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') + }) +} \ No newline at end of file