FAQ ACCORDION WITH HTML CSS JS.

Solution retrospective
I would appreciate alternative approach to completing the project.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Crystalis89
Visually looks about right and makes good use of semantic HTML.
As requested alternative way can do the JS portion is usage of things like "parentElement","nextElementSibling", and "firstElementChild". Also in combination with the above I targeted by using event.target in the listener.
For example: event.target.firstElementChild.src = assets/images/icon-minus.svg"
So with that from the event of clicking the button targeted the first child of the button element which for me was the icon image and changed it's src.
Marked as helpful
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