How do I have jQuery's autocomplete plugin display its dropdown list upon page load?

autocomplete, jquery, jquery-plugins

Solution

If, and only if, you are using a version of jQuery 1.3 or greater, you can create a `jQuery.Event` object, then `trigger()` it. I was only able to get it to work if the element is also focused. So this code works for the "E-Mail (local):" example on the demo page.

var e = jQuery.Event("keydown");
e.which = 40;
$('#suggest13').trigger('focus').attr('value',' ').trigger(e);

I'm not sure exactly what your situation is, I think it's somewhat dependent on the autocomplete actually showing something if only a space is pressed. That's not always the case.

Problem

http://community.sciencecareers.org/mt-static/plugins/CommunityPlus/js/autocomplete/ http://community.sciencecareers.org/mt-static/plugins/CommunityPlus/js/autocomplete/demo/ Trying to programmatically trigger the display of the autocompletion list results. This, instead of waiting for user input. Is this doable? (I've tried getting the element's focus, calling a Javascript down-arrow key event. No dice)

Original source