
Solution retrospective
This mini project was my first project in Frontend Mentor that uses JavaScript, and I solved the problem. This is amazing
What challenges did you encounter, and how did you overcome them?I got a little stuck in implementing the Hide/Show the answers, but after googling, I overcame it.
What specific areas of your project would you like help with?I want feedback on implementing the toggle of plus and minus icons. For now, if you click on an answer it hides the other answers and can't make the icons pluses, Do you have any feedback on it?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @LeviKuhaulua
Howzit, for this segment of code:
document.querySelectorAll('.answer').forEach(a => { if (a !== answer) { a.classList.add('hide') } })
Every time you click on a question, it is going to reapply the
hide
class to all of the other questions even if they were clicked on by the user previously. By removing this segment of code, it will allow the user to see the answers to all the questions.Hopefully this helped and happy coding!
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