0

I want to implement a custom search. My code: $(document).ready(function() {

$('#w-input-search').autocomplete({
    minLength: 1,
    delay: 500,
    source: function (request, response) {
        $.getJSON("/demo/account/getUsers", request, function(result) {
            response($.map(result, function(item) {
                return {                                                                    
                    label: "<img src='" + item.photoUrl + "'/>"+item.firstName ,
                    value: item.firstName,
                    tag_url: "http://" + window.location.host +"/tags/" + item.tagId + "/" + item.name
                }
            }));
        });
    },



});

This is displaying: enter image description here

How can I make that list to display images and not the text? "" I must sayI'm a jquery beginner.

UnguruBulan
  • 890
  • 4
  • 12
  • 24
  • Possible duplicate of [jQueryUI: how can I custom-format the Autocomplete plug-in results?](http://stackoverflow.com/questions/2435964/jqueryui-how-can-i-custom-format-the-autocomplete-plug-in-results) – Oden Feb 27 '16 at 12:08
  • 2
    Possible duplicate of [Using HTML in jQuery UI autocomplete](http://stackoverflow.com/questions/3488016/using-html-in-jquery-ui-autocomplete) – nikoshr Feb 27 '16 at 12:09
  • please read the autocomplete document to print html. Can show me the plugin you are using – Shelim Feb 27 '16 at 12:22

0 Answers0