Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 1 year ago

FAQ according main

PavvelD•40
@PavvelD
A solution to the FAQ accordion challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What specific areas of your project would you like help with?

I would like to ask for help with my Javascript solution. I have done listening on "click" and "keydown" to show the answers. I made switching between questions with "ArrowDown" and "ArrowUp", and opening the answer with "Enter". I also added a border to the current question selected with the key. When I switch only in one direction everything is OK, but if I want to change the direction of switching, the first step goes in the opposite direction than it should, then it is OK.

Please advise me what I could improve in my code, information on what I have done wrong. Thanks!

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on PavvelD's solution.

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License