Design comparison
Solution retrospective
i wanted to make like if one accordion is open then all other accordion should be closed automatically but i couldn't. though its easy with Bootstrap but i don't like Boootstrap.
Also when i was positioning the box it was so hard to keep it fixed in one position while resizing the screen because its position was absolute.
Community feedback
- @SamadeenPosted over 2 years ago
Hey!! Cheers 🥂 on completing this challenge.. .
Here are my suggestions..
- You should use <main class="container"> instead of <div class="container">.
- You can wrap your attribution section in a footer tag to avoid accessibility issues.
This should fix most of your accessibility issues
. Regardless you did amazing... hope you find this useful... Happy coding!!!
Marked as helpful1 - @fazzaamiarsoPosted over 2 years ago
Hello Dipu! Nice work!
Here is my solution to your question.
for (const items of faq) { items.addEventListener('click', function () { faq.forEach(item => { item.classList.remove('activate') }) // close all accordion items.classList.add('activate') // open the clicked accordion }) }
I hope it helps! Goodluck!
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord