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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:22:40+00:00 2026-06-14T03:22:40+00:00

$(selector).autocomplete({ … }).data( autocomplete )._renderItem = function( ul, item ) { return $( <li></li>

  • 0
$("selector").autocomplete({ ... }).data( "autocomplete" )._renderItem = function( ul, item ) {
    return $( "<li></li>" )
        .data( "item.autocomplete", item )
        .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
        .appendTo( ul );
};

from here

What is this bit doing .data( "autocomplete" ) I though data was used to attach key value pairs to dom elements as part of data-foo attribute. But that doesn’t seem the case here ?

  • 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-14T03:22:41+00:00Added an answer on June 14, 2026 at 3:22 am

    As per the documentation :

    • .data(name, value) is the setter : it attaches value to the name key
    • .data(name) is the getter : it returns the value attached to the name key

    In this case, the value is an object (which stores data about the autocomplete instance bound to the node), and this object is modified in place.

    It is a common pattern in the jQuery library to have a function trigger different actions depending on its arguments :

    • $(selector).click(myFunction) binds a handler to the nodes, $(selector).click() triggers the click event
    • in jquery-ui, $sel.widget('option', name, value) will generally allow you to change an option after a widget has been created, $sel.widget('option', name ) will allow you to get the value
    • etc …
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$('#selector').click(function() { // here I would like to load a javascript file // let's
I see this selector $( 'a + .firstSection a' ).live( 'click', function(){ in my
This is my custom selector (StateListDrawable) <selector xmlns:android=http://schemas.android.com/apk/res/android> <item android:drawable=@drawable/common_cell_background /> <item android:state_pressed=true android:drawable=@drawable/common_cell_background_highlight
I have a dropdown selector, with values from 1-4. Depending on the selection, subsequent
[NSThread detachNewThreadSelector:@selector(colourChange) toTarget:del withObject:nil]; This should call the colourChange method in the class' delegate(del)
I need to customize the combobox widget build from the jQuery UI Autocomplete http://jqueryui.com/demos/autocomplete/#combobox
I have the following problem. Background I'm trying to implement an autocomplete selector with
This is a topic selector made in <a> tag in php. Once user click
The 'focus' documentation from http://jqueryui.com/demos/autocomplete/ states : focusType:autocompletefocus Before focus is moved to an
http://jqueryui.com/demos/autocomplete/#combobox On the right hand side, there are selector tabs (with the selected arrow

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.