Handling the "Enter" / "Return" key in Chrome
<p>I have an AJAX-y type page. When the user clicks "GO" I need to execute a specific javascript function. I also want to simulate the "GO" click when a user hits "Enter" or "Return. Please note that I do not want to "submit" the page. The reason why is because i am doing everything via JavaScript.</p>

<p>To handle the "Enter" / "Return" key press in IE and FireFox, I am using the following code:</p>

<pre><code>$(document).ready(function () {  
  $('#root').keypress(function(e) { 
    if (e.keyCode == '13') { 
      goButton(); 
    } 
  });
});
</code></pre>

<p>Unfortunately, this code is not working in Chrome. The goButton() function gets called. The problem though is the page gets submitted. What am I doing wrong?</p>
