Design comparison
SolutionDesign
Solution retrospective
Feedbacks please...
Community feedback
- @matiasluduena23Posted about 1 year ago
Hi Oluwafemi! Nice work! this challenge is a little tricky! Just two advice.
- Use a
cursor: pointer
in you .question class. - I thing that is better if you wrap all your and listener for a click, something like this:
allQuestion = document.querySelector(".question"); allQuestion.forEach((question) => { question.addEventListener("click", (e) => { closeOtherQuestions() // close expanded add classes question.querySelector(.arrow).classList.toggle("arrowTransform"); } }) function closeOtherQuestions(){ allQuestion.forEach((question) => { question.classList.remove(active) } }
Good code!
Let me know if you don't understand something
Matias
Marked as helpful1 - Use a
Please log in to post a comment
Log in with GitHubJoin 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