How to toggle
by queryj
HTML
<div id="flip5"><a href="#">Demo <span id="togglebut">+</span></a></div>
<div class="hidden">
<p>
some content goes here.
</p>
</div>
CSS
.hidden
{
display: none;
}
JavaScript
$(function() {
$("#flip5").click(function(){
$("#togglebut").html(function(wonder, html) {
return $.trim(html) == '+' ? '-' : '+';
});
$("div.hidden").toggle();
});
});