This can be done using an image, div and javascript. Put those +,- images in your page. Then, handle click event for it and hide/show the div containing code block. Also, change the images then. Here[^] are a plenty of example showing that.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!