问题
what i want to achieve is, that when the autcompletion list is rendered, an additional div with one link is appended to the resultlist. somehow this is not working for me. i've tried
$(".ui-autocomplete").append('<div style="border:1px solid red"><a href="#">Click me to get in contact</a></div>');
but that's not working. If i do
$(".ui-autocomplete").append('<p>Ramo</p>');
then i get a red border around the ul element of the autocomplete box.That's fine, so i thought a simple append should work.
Any ideas for that issue?
Best regards, Ramo
回答1:
You could do
$( "#tags" ).autocomplete({
source: availableTags,
open: function(){
$(".ui-autocomplete").append('<li style="border:1px solid red"><a href="#">Click me to get in contact</a></li>');
}
});
fiddle here http://jsfiddle.net/uuPGq/
来源:https://stackoverflow.com/questions/8879930/append-one-link-to-jquery-ui-autocomplete