jQuery Toggle State
jQuery has two .toggle()
methods:
Toggles each of the set of matched elements. If they are shown, toggle makes them hidden. If they are hidden, toggle makes them shown.
Toggle between two function calls every other click.
In this case you want the first one. Something like this should do the trick:
$("a").click(function() { $("#theForm").toggle();});