title: Is there a more JQuery-istic way to combine handlers than a switch statement?
body: <p>Is it better to have multiple handlers for button click events, or is it suitable to combine click handlers with a switch statement? This works in my code, but I was wondering, is there a cooler, more JQuery-istic way to do it?</p>
  
  <pre><code>&lt;html&gt;
      &lt;button id="button1"&gt;Button 1&lt;/button&gt;
      &lt;button id="button2"&gt;Button 2&lt;/button&gt;
      &lt;button id="button3"&gt;Button 3&lt;/button&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Which is better, this?</p>
  
  <pre><code>$('button').click(function(){
      switch(this.id){
          case "button1": 
              alert("Do what button 1 says");
              break;
  
          case "button2":
              alert("Do what button 2 says");
              break;
  
          case "button3":
              alert("Do what button 3 says");
              break;
      }
  });
  </code></pre>
  
  <p>Or this,</p>
  
  <pre><code>$('#button1').click(function(){
      alert("Do what button 1 says")
  });
  
  $('#button2').click(function(){
      alert("Do what button 3 says")
  });
  
  $('#button3').click(function(){
      alert("Do what button 3 says")
  });
  </code></pre>
  
  <p>...Or is there no difference?</p>