If you want to make one, create a js script called accordion.html and copy the code into a new file, call it accordion.js, and put the accordion.html in the header of your page. Then, when you want to add a new div, use the add class to give it a div class name. In this case, we’re adding class name.
In addition to the accordion, make sure to install the bootstrap-accordion.js from the cdn.js package.
You can also change the accordion style to have it expand or collapse by changing the css style of the accordion and adding overflow: hidden.
The code above uses the accordion plugin, which is pretty easy and you can read more about it here.