jquery autocomplete set hidden input value
问题 I have the following jquery autocomplete which does work. <input type="hidden" id="autocompletePid" autocomplete="off" /> The relevant JS <script type="text/javascript"> $(function() { $("#autocomplete").autocomplete( { source : function(request, response) { $.ajax({ type : 'GET', url : "/live-search" + '?term=' + request.term, success : function(data) { response($.map(data, function(item) { return { label : item.street + ' ' + item.city.city + ', ' + item.state.stateCode + ' ' + item.zipcode