Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:39:05+00:00 2026-06-18T04:39:05+00:00

JQuery Autocomplete triggers a focus event when the user mouses over or otherwise highlights

  • 0

JQuery Autocomplete triggers a focus event when the user mouses over or otherwise highlights one of its <li> options. Within this event, I want to refer to the <li> that is currently focused, but I can’t figure out how to select it. At the moment, I have:

focus: function( event, ui ) {
  var target = event.currentTarget
  alert($(target).html())
}

But this returns the whole list of <li>s, rather than just the currently focused one. I’ve tried other event methods, such as event.delegateTarget and event.target, but with no success. Is there another way to get the focused element?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:39:06+00:00Added an answer on June 18, 2026 at 4:39 am

    You’re going to have to:

    1. Grab the menu widget that autocomplete is using.
    2. Get the li that’s currently focused (this li has an a with class ui-state-focus

      focus: function (event, ui) {
          var menu = $(this).data("uiAutocomplete").menu.element,
          focused = menu.find("li:has(a.ui-state-focus)");
          // focused is the focused `li`
      }
      

    Example: http://jsfiddle.net/J5rVP/43/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to trigger autocomplete list on focus or click event. This solution helps,
I'm using this JQuery autocomplete plugin http://www.devbridge.com/projects/autocomplete/jquery/ in my project. I followed this tutorial
I'm using JQuery UI Autocomplete to pull records from a caller database. This works
Jquery autocomplete is being used.On hover over an item in the dropdown list, the
jQuery autocomplete plugin sent request like this mysite.com/suggestion?term=Sadegh is there any way to change
Any jquery autocomplete plugin which consumes this json format? {Table : [{ClientName : Pandiya},
How do I trigger/call jQuery UI Autocomplete event handlers from each other, for example,
Have an issue with jquery autocomplete, focus function After i type something in the
I'm trying to trigger the jQuery Autocomplete event externally. The problem is I'm using
I'm using the jquery autocomplete function to enhance the user-friendliness of my site. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.