javascript - How to add a Button/Link to the last item in a list of search results -
i'm trying add button last item in list of results generating using jquery
autocomplete
. currently, each list item created so:
create: function(item) { $(this).data('ui-autocomplete')._renderitem = function (ul, item) { return $('<li>') .append('<a>' + item.label + " " + " - " + item.type +'</a>') .appendto(ul); };
},
what i'd when last element in list add button, can't figure out how that. i'd appreciate help.
you can use jquery pseudo selector last item.
$('li:last')
Comments
Post a Comment