
Design comparison
Solution retrospective
I managed to use JavaScript to make the FAQ work. But next time, I'd like to create a function to activate it and make the code shorter.
What challenges did you encounter, and how did you overcome them?Create a JavaScript program to run the FAQ. I had to do some research to find a solution. The one I did the first time didn't work
What specific areas of your project would you like help with?I'd like to improve my JavaScript skills. I'm having a lot of trouble writing programmes at the moment.
Community feedback
- @grace-snowPosted 5 months ago
I'm afraid this is inaccessible at the moment. It is essential to get the right markup with this. Disclosures / accordions need to be triggered with aria-expanded buttons.
Also note the images including icons should be treated as decorative.
Links to help you:
- Accordions: https://www.w3.org/WAI/ARIA/apg/patterns/accordion/
- Disclosures: https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/
- my blog post on this: https://fedmentor.dev/posts/disclosure-ui/
Marked as helpful0@SlideurPosted 5 months ago@grace-snow I checked my page and when you click on it, everything works. I'm sending you the link I have : https://faqaccordionmainfrontendmentor.netlify.app/ I thought the plus and minus were part of the links. I didn't know about the aria-expanded buttons system. I'll take a look at how it works. thank you for the links
0@grace-snowPosted 5 months ago@Slideur read the resources. This is an extremely important pattern, everyone has to understand the requirements. It must work for keyboards and voice control and screen readers (including communicating the expanded or collapsed state to screen readers).
Marked as helpful0@SlideurPosted 5 months ago@grace-snow I'd forgotten... These are things I've never done. I need to learn before I correct.
0@SlideurPosted about 2 months ago@grace-snow Hello, I've added the code for the accessibility. I'm not sure that's a good code but it works. I've been having some difficulties to understand these things ( may be the programming in general :-) )
0 - @grace-snowPosted about 2 months ago
It doesn't look like you've followed the pattern here https://www.w3.org/WAI/ARIA/apg/patterns/accordion/.
For example:
- aria-selected is incorrect for this interface.
- images should be decorative
- a strange cursor has been added to everything implying everything is interactive
As a general rule, try to avoid setting inline styles with javaScript. Styling should be a CSS concern. Change the aria, and optionally a class using JSm then use that as the style hook.
I wrote a blog about this same pattern that encourages people to use the aria-expanded value as the CSS selector to control visibility of everything else https://fedmentor.dev/posts/disclosure-ui/
0@SlideurPosted about 2 months ago@grace-snow I'll try to change my code. And I'm reading your article. I need to understand the process if I want to do that correctly. Thank you for your help... I haven't watched the strange cursor. I'm going to wach
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