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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:52:12+00:00 2026-06-07T15:52:12+00:00

Is it possible to add some html to jquery autocomplete ui item? For example,

  • 0

Is it possible to add some html to jquery autocomplete ui item?
For example, I’d like to add <strong></strong> tags to autocomplete resulting item label: item['name']. I’ve tried to do label: '<strong>'+item['name']+'</strong>, but it is applied as text, not HTML.

$('input[name="customer"]').catcomplete({
    delay: 0,
    source: function(request, response) {
        $.ajax({
            url: 'index.php?route=sale/customer/autocompletefilter_name=' +  encodeURIComponent(request.term),
            dataType: 'json',
            success: function(json) {   
                response($.map(json, function(item) {
                    return {
                        category: item['customer_group'],
                        label: item['name'],
                        customer : item['name'],
                        value: item['customer_id'],
                        customer_group_id: item['customer_group_id'],
                        firstname: item['firstname'],
                        lastname: item['lastname'],
                        email: item['email'],
                        telephone: item['telephone'],
                        fax: item['fax'],
                        address: item['address']
                    }
                }));
            }
        });
    }, 
    select: function(event, ui) {
        //some actions on select
    }
});

Thnak you.

  • 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-07T15:52:14+00:00Added an answer on June 7, 2026 at 3:52 pm

    Check out Scott Gonzales’ autocomplete HTML extension –
    https://github.com/scottgonzalez/jquery-ui-extensions/blob/master/src/autocomplete/jquery.ui.autocomplete.html.js. It’ll allow you to pass in HTML for the label option.

    Example – http://jsfiddle.net/eay3d/1/

    $(function() {
        var availableTags = [
            { label: 'Apple1', value:'Apple1' },
            { label: '<strong>Apple2</strong>', value:'Apple2' },
            { label: 'Apple3', value:'Apple3' }             
        ];
        $( "#tags" ).autocomplete({
            source: availableTags,
            html: 'html'
        });
    });
    

    Edit 09/22/2013: Source link repaired, but no longer maintained.

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

Sidebar

Related Questions

jQuery - Is it possible copy and paste HTML? Starting with an example, if
Is it possible to add icons to all/some of the menu-links in your account-dashboard?
I used glade to create some gtk buttons. is it possible to add an
I have a DIV containing text. Previously I just tried setting new HTML like
Is it possible to add php to a jquery function? On ajax success I'm
Is it possible to use JQuery & PHP to create a like button that
I am using jquery to add a few features onto some fields in the
I was wondering if it was possible to get Javascript to write some HTML
I would like to know if this is possible to add special character into
I'd like to add some kind of library, or maven plugin, or 'something' to

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.