JQuery AutoComplete, manually select first searched item and bind click [duplicate]
If you look at the way the jQuery team does it in their unit tests for autocomplete, they use something similar to the following code: var downKeyEvent = $.Event(“keydown”); downKeyEvent.keyCode = $.ui.keyCode.DOWN; // event for pressing “down” key var enterKeyEvent = $.Event(“keydown”); enterKeyEvent.keyCode = $.ui.keyCode.ENTER; // event for pressing “enter” key $(“#autoComplete”).val(“item”); // enter text … Read more