About AutoComplete Suggestions

About AutoComplete Suggestions

Hello everyone,

I would like to learn how to make this feature :

Let's say that we have an input with id="myList" we transform into an autocomplete select box.
  1. $(function()
  2. {
          var availableTags =

  3.       [
  4.             "c++",
  5.             "java",
  6.             "php",
  7.             "javascript"
  8.       ];

  9.       $("#myList").autocomplete(
  10.       {
                source   : availableTags,
          });
    });




I would like that the 1st value in the suggest list to be focused automatically but above all I would like that this 1st result be assigned as myList value.

At this moment i've tried with
  1.       $("#myList").autocomplete(
  2.       {
                source   : availableTags,
                open      : function(event, ui)
                {
                    $("#myList").val("test");
                }
            });







And the value is well assigned with menu always displayed but I can't get 1st item (or any other) of the suggest list.

Thx