title: Detect Enter key is pressed with jQuery
body: <p>I have a text field which is showing a value. What I want is when the user writes a new value in that text field and presses <kbd>enter</kbd>, an ajax function is triggered to do a pagination operation. I have a text field like this:</p>
  <pre><code>&lt;input type=&quot;text&quot; id=&quot;page&quot; name=&quot;page&quot; value=&quot;&lt;?php echo($this-&gt;pn);?&gt; /&gt;
  </code></pre>
  <p>And when a user writes any new value and presses <kbd>enter</kbd>, I want the following ajax function triggered:</p>
  <pre>
  update_ajax2({rpp:&lt;?php echo($this->rpp);?>,pn:document.page.paged.value,filter:'&lt;?php echo($this->filter);?>',orderby:'&lt;?php echo($this->orderby);?>'});
  </pre>
  <p>I tried using the keypress event to detect <code>if(e.which===13)</code> but this doesn't solve the problem. Can anyone guide me?</p>