Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

FAQ Accordion card

#accessibility

@Kolade1024

Desktop design screenshot for the FAQ accordion card coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Feedbacks please...

Community feedback

@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

Please log in to post a comment

Log in with GitHub
Discord logo

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