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 main

@tushar416

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


hello there! can you tell me? how I can close another collapse when I click on another. any help would be appreciated. thanks!

Community feedback

Rayane 1,935

@RayaneBengaoui

Posted

Hello Tushar,

First of all, congrats for the challenge !

To achieve this you could use Javascript. I think you could find plenty of solutions here that have implemented this to get inspired but one idea might be to create a function that iterates through all your collapse elements to remove the class active. Then you would just have to call this function before your this.classList.toggle("active");

Overall, well done for the challenge and happy coding ! 😃

0

@tushar416

Posted

@RayaneBengaoui thanks a lot!

0

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