Responsive Faq Accordion Card using SASS with partials/vanillaJS
Design comparison
Solution retrospective
Hi guys,
Appreciate any feedback, especially on the following:
-
the way I wrote my JS. I'm not sure if that is the right way, but since certain elements needed to be changed while others not, I made use of an array and filtered it as well in order to apply classes to certain elements only. Is this the right way? or is it too work-intensive?
-
I'm getting an issue when checking the accessibility in the browser devtools. "Clickable events must be focusable and should have interactive semantics" The arrow icon is inside an my button though. How do I fix this?
-
HTML5 markup, especially from an accessibility stand point. I feel like I need to still work on that a lot.
Community feedback
- @stfnpczkPosted over 2 years ago
Hi Daniel,
in regard to the js, I was asking myself the same question and stumbled upon the
details
element. It has a built in open state that can be toggled. So you can loop through all detail DOM elements and disable the open attribute for all except the one you clicked. For my solution, I was referencing the js in this post here.0
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