Responsive FAQ Page using HTML, CSS and JavaScript

Solution retrospective
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.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @kodan96
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 theforEach()
method withaddEventListener
.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