Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
theiadeb authored Nov 12, 2024
1 parent 42892e7 commit 2a99df7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// script.js

document.querySelectorAll('.accordion-button').forEach(button => {
button.addEventListener('click', () => {
const content = button.nextElementSibling;
content.style.display = content.style.display === 'block' ? 'none' : 'block';
});
});

0 comments on commit 2a99df7

Please sign in to comment.