Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ Accordion

OlolaJaco 130

@OlolaJaco

Desktop design screenshot for the FAQ accordion coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What specific areas of your project would you like help with?

Changing the icon upon clicked, still wasn't able to change it using the svg file given

Community feedback

Alex 3,130

@Alex-Archer-I

Posted

Hi!

You can't change src of the icon cos you are using querySelector(".icon"). It takes as parameter the same selectors as in css. So, you are trying to get element with a class icon, but you only have element with id icon.

To reduce the number of constants and the make your code cleaner at all, you can use querySelectorAll() to get all the elements with the same selectors and write one function for all of them.

Hope that helps. Feel free to ask if you have any questions =)

0

Please log in to post a comment

Log in with GitHub
Discord logo

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