How do I alternate between calling two functions on click? For example, here is the button
and here is the j
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.