6

Enter key does not open drop down in Mozilla. Works fine in Chrome.(Its chrome default behavior)

Trying something like this to achieve it in Mozilla

var self = this;
    $('select').on('keyup', function (e) {
        if (e.keyCode == 13) { $(this).trigger('click'); }
    });
Rohit Kumar
  • 829
  • 2
  • 12
  • 21

2 Answers2

4

According to this page, the shortcut for Mozilla is Alt+Down Arrow, for select boxes, arrow keys to scroll, Enter to select.

  • thanks. can we manually trigger a event for alt + drown arrow? – Rohit Kumar Aug 10 '15 at 07:53
  • 1
    See [this](http://stackoverflow.com/questions/832059/definitive-way-to-trigger-keypress-events-with-jquery), [this](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/altKey) and [this](http://stackoverflow.com/questions/10671822/jquery-handling-key-combinations) – ThreeSidedCoin Aug 10 '15 at 08:02
  • Enter key does not open drop down in Internet Explorer as well. Above solution works for IE as well. The shortcut of Alt+Down Arrow, for select boxes opens dropdown in IE. – Abhijeet Giram Aug 06 '20 at 08:27
0

Are you trying in select box? If yes then trigger is not possible.

You can try on some other elements(div,ul li,..) similar to select box.

ManiMuthuPandi
  • 1,594
  • 2
  • 26
  • 46
  • Is this still valid anno 2018? I'm trying to let a – DutchKevv Apr 17 '18 at 14:51