i have the following jquery code:

Code JavaScript:

this has a <div class="showhide"> which has the current text 'click here to expand/contract', which expands a <div class="slidingDiv"> or collapses it, whether it is open or closed. is there a way i can ammend this code so when the .slidingDiv is hidden, the div 'showhide' says 'click here to expand' and when .slidingDiv is shown, change the div 'showhide' to say 'click here to close'?