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

Landing page with HTML5/SCSS AND VANILLA JAVASCRIPT

#accessibility#bem#sass/scss
Nneoma Njoku 1,210

@SatellitePeace

Desktop design screenshot for the Bookmark landing page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Is there any way i can make a faq to close when another is opened.

I tried this

openFaq();

function openFaq(e) {
  for (let i = 0; i < showAnswer.length; i++) {
    showAnswer[i].addEventListener("click", (e) => {
      hideFaqs();
      answers[i].classList.toggle("open");
      closeFaq[i].classList.toggle("active");
      e.preventDefault();
    });
  }
}

function hideFaqs() {
  answers.forEach((ans) => {
    ans.classList.remove("open");
  });
}

which worked except for the fact that i could no longer close an faq without leaving another one open.

Community feedback

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