John McCallum basically has your answer, but you can also use shorthand Javascript to make your code a little more compact:
$('#toggle').click(function(ev) { $('#content').toggle(); this.html(($('#toggle').text() == 'Show more') ? 'Show less' : 'Show more'); })
EDIT: For clarity, I will also add the html markup you need for the above code to work. This example shows that everything starts with.
<p><a id="toggle" href="#">Show less</a></p> <div id="content"></div>
If you want it to be hidden for starters, you simply change the link text to "Show more" and add the following style rule to the stylesheet:
#content { display: none; }
source share