7 July 2016

Simple jQuery accordion

Assuming your HTML is something along these lines:

Just hide the .body with your CSS:

And here’s the jQuery:

Check out the working demo, with some additional styling.