// The next line initialises the open/close areas by hiding the content $(".markdown-block .sqs-block-content h2").nextUntil("h2").slideToggle(); //Finally, there is a function that listens for a click on an H2 and either shows or hides its content depending on its current state. $(".markdown-block .sqs-block-content h2").click(function() {$(this).nextUntil("h2").slideToggle();}); });