title: How do you return all the posible value in a switch statement
body: <p>So i was wondering how do i shows the result once someone inputs the letter A.</p>
  
  <p>the problem is it shows up for a few seconds and disapears</p>
  
  <p>here's my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function pop(){
      var text = document.getElementById('Search_Text').value;
      var res = text.split("");
      for (var i = 0; i &lt; res.length; i++){
          switch(res[i]) {
              case "a":
                  alert("a");
                  break;
              case "A":
                  document.getElementById("result").innerHTML="C";
                  break;
           }
      }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form onsubmit=""&gt;
      &lt;input type="text" id="Search_Text"&gt;&lt;/input&gt;
      &lt;button type="submit"onclick="pop()"&gt;change&lt;/button&gt;
  &lt;/form&gt;
  &lt;p id="result"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>