FAQ accordion made using pure CSS without JavaScript
Design comparison
Solution retrospective
Doing that without JavaScript was kinda hard and seems too much hacky, I also don't know how to hide collapsed option when clicked again if I can't use JavaScript. Is this even possible? What else can I change to improve this project? Thank you for your time checking this work :D
Community feedback
- @gschiferPosted almost 4 years ago
Hi, Konrad, how are you doing?
I'm wondering why you didn't use JS to make things more simple. Was some kind of challenge? hahah
You can check my code here https://github.com/gschifer/FrontEnd-Mentor-Accordion, I think that this would help you.
2@Nexi77Posted almost 4 years ago@gschifer Yeah I knew exactly how to do this in JavaScript so I wanted a bigger challange, u can also find in a description to this challange that it is has bonus option that want us to make it without JavaScript :D How do u like it?
I would recommend you stop using "var" while u make variables. The correct and most used ways now when ES6 is here is to make use of let and const keywords. Also document.querySelector is better to get elements from the DOM because u can pass everything as an argument, ID,class,other attrib so check it out :D
1@gschiferPosted almost 4 years ago@Nexi77 Thanks, Konrad for your suggestion. I'll use "querySelector" and "let" in the next few projects that I'm gonna build, so sorry for not being able to help you in this challenge, at least I could learn more with you :D.
Take care!
1
Please log in to post a comment
Log in with GitHubJoin 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