The accordion is one of the beautiful things that you can build with JavaScript. This can be useful for example when we have some frequently asked questions and we want to display them with their answers on our web page.

Last month, I built a simple Accordion, it was one of the projects that I have tried in my 100 days of code challenge. So before trying this project, you will need to have basic knowledge of HTMLCSS, and JavaScript. Let’s see how our simple project looks.

The Project Demo

As you can see in the example above, the idea of this project is very simple. You have some elements that contain questions. When you click the icon, the answer to that question will be displayed. It seems easier, but a lot of logic is going on there.

#js #javascript

Building an Accordion with Vanilla JavaScript
2.45 GEEK