Jquery autocomplete - custom html for result listing

前端 未结 4 1567
夕颜
夕颜 2020-12-24 12:59

I am referring to this plugin: http://jqueryui.com/demos/autocomplete/

So the original structure for the results is

4条回答
  •  一生所求
    2020-12-24 13:23

    You could try add the attributes with the event "open":

    $( ".selector" ).autocomplete({
        open: function(event, ui) {
            var jArrEl = $("a.ui-corner-all");
            jArrEl.addClass("myclass");
            jArrEl.attr("customattribute","something");
        }
    });
    

提交回复
热议问题