Adapted to allow use of icons Font Awesome instead of text (+/-).
May very well be improved upon. I just fancied sharing my adaptation to get used to GitHub and contributing to open source ;)
Just include the css and js files. jQuery is a dependency.
Add 'class="collapsible"' to a fieldset to have it collapsed by default; by clicking on its you toggle between visible and not.