Matias Ludueña• 1,960
@matiasluduena23
Posted
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 helpful
1