@12Kentos
Posted
Hey @neuyann,
Nice job on finishing this challenge especially with it being the first one you used Javascript on!
If you check out jQuery, I would suggest you keep working on learning vanilla Javascript as well. Yes jQuery is easier, but the better you know vanilla Javascript, the easier jQuery will be to use, and you will be able to do things people who only know how to use jQuery won't be able to do. ;)
As for the Javascript, have you heard about event listeners? If not I would suggest you look into them, as I was able to complete the challenge with the following Javascript.
`const faqs = document.querySelectorAll(".faq-card__text__container");
faqs.forEach((faq) => { faq.addEventListener("click", () => { faq.classList.toggle("active"); }); });`
copy and pasting this into your project wouldn't work, as my html is structured differently. However I'd be happy to help find some good places to learn more about event listeners, how they work and what not. Feel free to check out my solution to the project, and compare. :)
Keep up the great work!
Marked as helpful