Skip to content

Commit 6694427

Browse files
Update script.js
1 parent ec021c9 commit 6694427

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

FAQ Application/script.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
const faqs = document.querySelectorAll('.faq');
22

33
faqs.forEach((faq) => {
4-
faq.addEventListener('click', () => {
5-
faq.classList.toggle("active");
6-
});
7-
})
8-
4+
faq.addEventListener('click', () => {
5+
faq.classList.toggle("active");
6+
const content = faq.querySelector('.faq-content'); // assuming the content is in an element with class 'faq-content'
7+
content.classList.toggle("active");
8+
});
9+
});

0 commit comments

Comments
 (0)