title: Javascript switch statement with input text
body: <pre><code>&lt;script&gt;
  document.getElementById("clicker").onclick = function () {
      var scenario = document.getElementById('scenario');
      switch (scenario) {
          case 1:
              document.getElementById("answer").innerHTML = "How are you?";
              break;
          case 2:
              document.getElementById("answer").innerHTML = "whatevers";
              break;
          case 3:
              document.getElementById("answer").innerHTML = "i don't know";
              break;
          case 4:
              document.getElementById("answer").innerHTML = "today is your lucky day";
              break;
          default:
              document.getElementById("answer").innerHTML = "This is the worst case scenario";
      }
  }
  &lt;/script&gt;
  
  &lt;input type="text" id="scenario" /&gt;
  &lt;input type="submit" id="clicker" /&gt;
  &lt;p id="answer"&gt;&lt;/p&gt;
  </code></pre>
  
  <p>So here i'm trying to basically have a text field where the user will type in some value
  based on that value, the script will then look at cases and determine what to output in the paragraph element. </p>
  
  <p>Please advise how i should correct this code. </p>