@0xabdulkhaliq
Posted
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have a suggestion regarding your code that I believe will be of great interest to you.
ACCORDION 🔴 :
- The best way to go with creating the accordion elements in this challenge would be with the
details
andsummary
elements. They will help us to create an accessible solution in a HTML native semantic way to create accordion elements.
- I see you have used the
button
&p
elements for the accordions by utilizingaria
attributes, but those are not easy way of doing things using HTML native features.
- By using
details
andsummary
elements we don't need to manually handle things using JavaScript, we can write efficient markup with this one!
- MDN's reference is a great place to start learning about the
details
andsummary
elements if you are interested.
- If you have any questions or need further clarification, you can always check out
my submission
for this challenge and/or feel free to reach out to me.
.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
Happy coding!
@Fejiro001
Posted
@0xabdulkhalid Thank you for the suggestions. I have actually used details and summary for the other FAQ frontend mentor challenge, so I wanted to try other ways to do it. I got this method from W3C Web Accessibility Initiative.
But definitely using details and summary in the long run.