title: Switch Case does not respond to initialized function
body: <p>I have recently being practicing an example from a JS book and even after copying the example I was not able to achieve the desired results</p>
  
  <p>Here's the HTML:</p>
  
  <pre><code>&lt;form action="#"&gt;
      &lt;input type="button" value="Lincoln" id="Lincoln"&gt;
      &lt;input type="button" id="Kennedy" value="Kennedy"&gt;
      &lt;input type="button" id="Nixon" value="Nixon"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here's the JS</p>
  
  <pre><code>window.onload = initAll;
  function initAll() {
      document.getElementById("Lincoln").onclick = saySomething;
      document.getElementById("Kennedy").onclick = saySomething;
      document.getElementById("Nixon").onclick = saySomething;
  }
  
  function saySomething() {
      switch(this.id) {
          case "Lincoln":
              alert("Four score and seven years ago...");
              break;
          case "Kennedy":
              alert("Ask not what your country can do for you...");
              break;
          case "Nixon":
              alert("I am not a crook!");
              break;
          default:
      }
  }
  </code></pre>