$("a.question").click(function () {
var $this = $(this);
$this.next(".answer").slideToggle('fast', function () {
$this.text($(this).is(':visible') ? "Show Question" : "Hide Question");
});
});
Fiddle: http://jsfiddle.net/9tSww/1/
.. now this almost works except when you click on the trigger first time, it doesn’t now update the label, it works only from the second time its clicked.
Use the following instead.