I know, I need to start using React... Promise will do it in next project :-)
Samir
@ryuzaki979All comments
- @martinianolSubmitted almost 3 years ago
- @marcosfsousaSubmitted about 3 years ago
I wanted to start practicing with JSON and the Fetch API and with this challenge I got just what I wished for.
What seemed another head scratcher at first with heaps of lines of JS code resulted in a quite simple few lines with a
forEach()
function. Nonetheless, I've seen here much more elegant solutions for this challenge.There is room for improvement as always!
I appreciate your time to look at my code, critique and help in any way possible.
Obrigado.
@ryuzaki979Posted about 3 years agoYou did great. Here is my solution for this challenge https://www.frontendmentor.io/solutions/time-tracking-dashboard-h4WS8J_gO
have a look.
1 - @alynaugSubmitted about 3 years ago
This is my first solution using JavaScript. It was very challenging for me. Any feedback would be great! I added a little animation just for fun XD
@ryuzaki979Posted about 3 years agoyou can show one and hide except the active links easily like this. const faqs = document.querySelectorAll('.accordion__faq') faqs.forEach(faq=>{ faq.addEventListener('click',()=>{ faq.classList.toggle('active') faqs.forEach(item=>{ if(faq!= item){ item.classList.remove('active') } }) }) })
I also did this projects. Here is my solution: https://www.frontendmentor.io/solutions/faqaccordioncard-oaerihiiF
Marked as helpful0 - @ryuzaki979Submitted about 3 years ago
Provide your solution link if you done it. Thanks