Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 2 years ago

FAQs accordion solution

Che Fernandez•170
@CheFernandez99
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


As a new front end dev my biggest challenge was not knowing that you cant have the same class on multiple buttons when using it for the same function in JS, I'm aware there is a way to do it however I wanted to see what I could come up with on my own. By the time I realized my problem my project was basically done and i'd tried multiple solutions, which was beyond my skill level. So I took my original code which was working for one button and I changed the class names for the others and copied pasted my JS.

areas I'm unsure of my overall structure of HTML and the font which I could not find in VS (work sans). Also I know theres another way to toggle the icon I just came up with the button element for the icon and left it that way cause thats my own thought process

if anyone could recommend javascript that I could use, such as one function for example with multiple buttons with the same classes.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Che Fernandez's solution.

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

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

Frontend Mentor

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

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