How do I alternate between calling two functions on click? For example, here is the button
and here is the j
Use jQuery's toggle() method
$("#fooButton").toggle(fooOne, fooTwo);
Edited to make use of your named functions rather than sloppily using anonymous ones.
You can use the toggle pseudo-event:
$('#fooButton').toggle(fooOne, fooTwo);
Note: This is deprecated as of jQuery 1.8 and removed in jQuery 1.9+. You can use jQuery-migrate if you need this function anyway.