Arnaud
Arnaud

Reputation: 13

Jquery UI Autocomplete

Please let me know how to get the value of the first item in the list without it being selected?

Basically I type in some letters a few options come up but the user does not select or highlight them. I just want to capture the first option in the list and save that in a variable.

I would appreciate any help.

And yes I did have a look on the site first but did not spot the answer.

Many thanks

Upvotes: 0

Views: 396

Answers (1)

Abdul Kader
Abdul Kader

Reputation: 5842

The jQuery autocomplete generated list has class similar to ui-autocomplete ui-menu ui-widget ui-widget-content ui-corner-all

$('.ui-autocomplete li:first')

will get you the first li

Upvotes: 1

Related Questions