javascript - how to append values selected from autocomplete js -
what need
- i need append values in html selected values autocomplete
code
$('.autocomplete_ind').autocomplete({ lookup: industrys, onselect: function(suggestion) { console.log(suggestion); var thehtml = '<strong>industry name:</strong> ' + suggestion.name + ' selected<br> <strong>'+ suggestion.id+'</strong>'; $('#outputcontent').append(thehtml); $(this ).attr( "value", suggestion.value ); } html element
<input type="text" autocomplete="off" onchange="make_url();" id="industry_name" class="biginput autocomplete_ind" name="allindustry" value=""> - i have tried with
- both of solution not works .
- i on select values autocomplete values should view view source otherwise value remain empty .
- document.getelementsbyname('allindustry')[0].placeholder=suggestion.value;
- $(this ).attr( "value", suggestion.value ); works append value attribute value="somevalue"
- but on view source value="" empty shown.
- any suggestion welcome
Comments
Post a Comment