title: jQuery events don't occur after I change button class
body: <p>I am trying to change my buttons' classes when being clicked so as to perform different actions the next time they are clicked. (I do not want to use toggle)</p>
  
  <p>After changing the class, the next time these buttons are clicked nothing occurs even though the class has been changed. Can anyone please help me out? I am just starting to pick up jQuery so I don't know a lot of advanced mechanisms. </p>
  
  <pre><code> $(".showcontactbutton").click(function(){
      $("#contactform").show();
      //$(this).attr('class', 'hidecontactbutton');
      $(this).removeClass('showcontactbutton').addClass('hidecontactbutton');
      $(this).text("Hide Contact Form");
      //html("&lt;button id='hidecontactbutton'&gt;Hide Contact Form&lt;/button&gt;");
  
  });
  
  $(".hidecontactbutton").click(function(){
      alert("Works:");
      $("#contactform").hide();
      //$(this).attr('id', 'showcontactbutton');
      $(this).removeClass('hidecontactbutton').addClass('showcontactbutton');
      $(this).text("Contact Us");
  });
  </code></pre>