0

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

1
  • 1
    post the code you have so far Commented May 18, 2011 at 11:44

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Hey Abdul,Many thanks for the help. I added .text to the end of that and it worked like a charm. Thanks a million for the help and apologies for the late response.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.