Accordion Functionality can be achieved by many ways one of the way is using jquery.
Name the above file as accordion.html and in the same folder jquery.js file.
you can download same for free from here.
and then have your custom according just waiting for you to use.
the output looks like this :
Reference : Dilip Kumar Jena ( https://mstechexplore.wordpress.com )