Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    the secret is the conditional before the method to be executed $event.which === 13 && action() - thanks! Commented Jun 22, 2015 at 23:52
  • 1
    '$event.which' is not working for me, but I found '$event.keyCode' which is working. Commented Aug 11, 2015 at 14:11
  • event.which is undefined in IE<9 on keydown and keyup. Commented Aug 18, 2015 at 1:44
  • 2
    "old browsers like IE9" .. never thought this day will come :) Commented Feb 7, 2017 at 12:32
  • 1
    Why hasn't anyone updated the code snippets here to use $event.keyCode then? I'd edit it myself, but I'm unable to for some reason. Commented Apr 20, 2017 at 18:03