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 3219442
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:38:46+00:00 2026-05-17T15:38:46+00:00

From the jQuery UI documentation : widget .autocomplete( widget ) Returns the .ui-autocomplete element.

  • 0

From the jQuery UI documentation:

widget

.autocomplete( "widget" )
Returns the .ui-autocomplete element.

How can I use this in conjunction with actually specifying parameters for the autocomplete? I have a scenario such as this:

$("#employees").autocomplete({
    source: '/roster/home/search'
});

I would like to add a specific CSS class to the ui-autocomplete. I know I can specify a new .ui-autocomplete css class, but that isn’t what I need to do. I need to add an existing css class to it. The ‘widget’ thing seemed to be the appropriate approach, but I’m confused as to how it would be used. Any suggestions? The documentation doesn’t make this very clear at all.

  • 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-05-17T15:38:47+00:00Added an answer on May 17, 2026 at 3:38 pm

    .autocomplete("widget") returns a jQuery object that’s a wrapper for the actual
    class="ui-autocomplete" element it creates, so you can just call .addClass() on it, like this:

    $("#employees").autocomplete("widget").addClass("myClass");
    

    You can test it out here, in your case you can chain it as well:

        $("#employees").autocomplete({
            source: '/roster/home/search'
        }).autocomplete("widget").addClass("myClass");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I learned that by trying to use the tablesorter plug in from jquery the
This is related to my question on how to handle errors from jQuery AJAX
This is my first time attempting to call an ASP.NET page method from jQuery.
If I have an ASP.NET MVC controller action that is called from a jQuery
How do you compare a value from jQuery with a fixed number? I thought
Trying to include ThickBox (from http://jquery.com/demo/thickbox/ ) in an ASP.NET application. Visual Studio is
I am calling a .txt file from a jquery ajax call. It has some
How would you access the cache from a jQuery ajax call? I'm using jquery
We're considering switching our site from Prototype to jQuery. Being all-too-familiar with Prototype, I'm
Does anyone know of an easy way to escape HTML from strings in jQuery

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.