Is there a way to create an accordion where all the tabs start off closed, but open when clicked and close when clicked again? I have managed to open one tab, but I am struggling to figure out how to close it and how to make the opening and closing process generalizable.
I have created a codepen example to illustrate what I have accomplished so far. Click on the blue div to reveal the hidden paragraph.
<http://codepen.io/anon/pen/qbMBXd>
[Edited: Additionally, when one tab is open and I click on another tab, the first tab should close, leaving only the currently open tab visible]