Help with .click() and multiple clicks

Help with .click() and multiple clicks

Hi guys, I want to use .click() to toggle between two states, for example:

  1. <script type="text/javascript"> 
  2.  
  3.        $(function(){
  4.   
  5.   $('a.add').click(function(){
  6.   $(this).removeClass().addClass('remove').html('remove');
  7. return false;
  8. });
  9. $('a.remove').click(function(){
  10. $(this).removeClass().addClass('add').html('add');
  11. return false;
  12. });
  13.   
  14. });
  15.     </script>
  16.     
  17.     <p>
  18.     
  19.     This is a test... <a href="#" class="add">Add me</a>
  20.     
  21.     </p>
In the above code, what I'm trying to do is toggle between the two css classes .add and .remove.  The change is occurring in one direction only.

It seems to be a simple solution, but it's avoiding me at the moment.