Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 year ago

Responsive FAQ Page using HTML, CSS and JavaScript

Jarol•80
@MirrorInstinct
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

Even though the route I took to create this website was not the most optimal way to do it, I was at least happy that I commited and made it to the end so that I can at least show that I tried my best. Next time I will think more outside of the box and not rely on something so limited like using "details" or "summary" to make a project like this.

What challenges did you encounter, and how did you overcome them?

As mentioned in the last comment, there using both "details" and "summary" felt very limited and it just barely got me by to finish the project. Regardless, I did a lot of research to overcome those limitations and ended up with a finished product. Stackoverflow and w3schools really is your best friend. I also had a lot of trouble with JavaScript but again I was able to look and find information on what I could do make it work the way I needed it to.

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

As you will see, I really really struggle with JavaScript and I had to come up with something that at least made my project work but I can tell that it is far from the most optimal way to have made this project. I tried a few things and this was the only solution that I could get to work with my project. I don't doubt that I have a lot to work on.

Code
Couldn’t fetch repository

Please log in to post a comment

Log in with GitHub

Community feedback

  • Koda👹•3,830
    @kodan96
    Posted about 1 year ago

    hi there! 🙌

    Instead of adding different classes for the icons and the drop-downs you can use the same class, select them with querySelectorAll, which creates an array from these elements. from there you can use the forEach() method with addEventListener.

    This approach can save you a couple of lines of code and keeps your code readable.

    Hope this was helpful 🙏

    Good luck and happy coding!

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub