title: Onkeypress enter event not firing
body: <p>My onkeypress event is not working on the search bar on my website. Here's my javascript and html code:</p>
  
  <pre><code>window.onload = function() {
      document.getElementById("SearchText").value = getParameterByName("s");
  
      var a = document.getElementById("SearchLink");
  
      a.onclick = function() {
          search();
      }
  }
  
  function search() {
      var searchResultsUrl = "/search/";
      document.location.href = searchResultsUrl + "?s=" +
      document.getElementById("SearchText").value;
      return false;
  }
  
  function getParameterByName(name) {
      var match = RegExp('[?&amp;]' + name + '=([^&amp;]*)')
          .exec(window.location.search);
  
      return match &amp;&amp; decodeURIComponent(match[1].replace(/\+/g, ' '));
  }
  </code></pre>
  
  <p>And here's the  html code:</p>
  
  <pre><code>&lt;input type="text" id="SearchText" onkeypress="if(SearchText.keyCode==13)search()" /&gt;
  </code></pre>