1

Code:

$(document).on("keypress", ".className", function (e) {
     debugger;
     if (e.which == 13) {
     debugger;
           ....
           ...
    }
}

Above code triggers in IE, CHROME but not works in FIREFOX

Note: I had already refer the following SO links related to this, but nothing makes firefox to trigger..

onKeyPress event not working in Firefox

Key press event is not working in Mozilla Firefox

keypress is not working in Mozila Firefox

Community
  • 1
  • 1
Earth
  • 3,477
  • 6
  • 37
  • 78

1 Answers1

0

You should use e.charCode in Firefox.

$(document).on("keypress", ".className", function (e) {
     var code = e.charCode || e.keyCode;
     if (code == 13) {
     debugger;
           ....
           ...
    }
});
void
  • 36,090
  • 8
  • 62
  • 107