开发者

Trying to show the selected option from an autocomplete input select

开发者 https://www.devze.com 2023-02-12 16:13 出处:网络
I\'m trying to show the option that has been selected in an autocompleting input select. I\'m using the autocomplete jQuery plugin.

I'm trying to show the option that has been selected in an autocompleting input select. I'm using the autocomplete jQuery plugin.

This is the code:

$('#autocomplete_name').change(function(){
   $('#').append($('#autocomplete_name').val()); 
}); 

But when i select an option it shows the piece of text I have written in the input select, not the selected option.

Any idea?

Regards

开发者_开发问答

Javi


Read the documentation!

Something like:

$('#autocomplete_name').result(function(event, item) {
   $('#').append(item); 
});
0

精彩评论

暂无评论...
验证码 换一张
取 消