Possible Duplicate:
Toggle button and Toggle visibility
I have a piece of text on a page which acts as a button,
<span class="button">Show Activities</span>
When you click it it hides or shows some html. I want to change the html of it so I tried this
$('.button').click(function() {
$(this).siblings('.overview').slideToggle('slow');
$(this).html("<span>Hide activities</span>")
});
It changes the text of the html, but I want it to change back when I click it again. Is there a function like toggle but for putting html back to the start?
Try this