Trying to show the selected option from an autocomplete input select
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);
});
精彩评论