Modify ↓
Ticket #6951 (closed bug: worksforme)
.keydown() not working in IE7 for Enter keybutton
| Reported by: | jtanmay | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.4.3 |
| Component: | unfiled | Version: | 1.4.2 |
| Keywords: | .keydown() | Cc: | |
| Blocking: | Blocked by: |
Description
I tried even on the demo on live jquery site, .keydown() does not handle the Enter button.
Change History
comment:1 Changed 3 years ago by addyosmani
- Priority set to undecided
- Status changed from new to closed
- Resolution set to worksforme
comment:2 Changed 3 years ago by sderickson@…
I had the same problem, but I believe it has to do with IETester. I was running test in IETester in an IE8 tab and, as the OP said, the Enter key was not being registered for keydown events. I then went to another computer running IE8 without the aid of IETester and the keydown event fired as it should.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

The keyCode for the return/enter button is '13'. The demo on the jQuery API Documentation site that lets you test .keydown() is actually doing the following when you hit the return key:
if (event.keyCode == '13') {
If you actually code up your own routine using .keydown() with a simple alert(event.keyCode) and test this in any version of FireFox, Chrome or IE, you'll find that they all correctly capture the enter key being pressed.
I've verified this across IE 7, 8 and 9 just to ensure it's working fine.
Closing ticket.