I'm trying to open/close a select dropdown content programmatically, but I can't figure out how to call "open" and "close" on the select
Here's an example: Fiddle
CODE
$(document).keyup(function(e){
if(e.which >= 48 && e.which <= 57){
$("#myselect").click();
$("#keyOpen").empty().text(e.which);
}else if(e.which >= 58 && e.which <= 90){
$("#myselect").trigger("click");
$("#keyClose").empty().text(e.which);
}
});
if the key pressed is numeric (0-9), it should open, if the key pressed is a char (a-z), the select should close.
this set of char is just an example, I'd like to bind the open/close gesture to a keyboard input.
Any ideas?
Thanks in advance, best regards