FAQ accordion using Sass

Solution retrospective
Overall, I learned to use new tags () in HTML for creating collapsible sections. Additionally, I explored how to incorporate JavaScript to toggle classes and enable keyboard navigation through properties.
document.querySelectorAll(".faq_heading").forEach((heading) => { heading.addEventListener("click", () => { const faqItem = heading.parentElement; faqItem.classList.toggle("active"); }); });
What challenges did you encounter, and how did you overcome them?:focus-visible { outline: 0.1875rem dotted #9b59b6; outline-offset: 0.125rem; }
Following the model was a bit tricky. The unique way to achieve the same result was by using in HTML to create collapsible sections.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Carlos Pizarro's solution.
Join 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