title: jQuery change checkbox button text when clicked
body: <p>I have some jQuery checkbox buttons, and they work fine. However, I would like to change their text upon a click. for example: the button's text is "click me". when the user clicks it, i needs to change to "thanks for clicking", for example.</p>
  
  <p>This is what I am trying using:</p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          $("#button").button(); 
          $("#button").click(function(){
              if($("#label").is(':checked')) {
                  $("#label span").text("Hide");
              }
              else {
                  $("#label span").text("Show");
              }
          });
      }); 
  &lt;/script&gt;
  &lt;input id='button' type='checkbox' /&gt;
  &lt;label id='label' for="button"&gt;Show/Hide&lt;/label&gt;
  </code></pre>