Javascript .keyCode vs. .which?
<p>I thought this would be answered somewhere on SO, but I can't find it.</p>

<p>If I'm listening for a keypress event, should I be using .keyCode or .which to determine if the enter key was pressed?</p>

<p>I've always done something like the following:</p>

<pre><code>$("#someid").keypress(function(e) {
  if (e.keyCode === 13) {
    e.preventDefault();
    // do something
  }
});
</code></pre>

<p>But, I'm seeing examples that use .which instead of .keyCode. What's the difference? Is one more cross-browser friendly than the other?</p>

<p>Thanks.</p>
