How to use Ajax and the HTML structure to echo autocomplete options?
问题 I want to create an autofill search box. it gets a JSON and sends them to an HTML5 <datalist> of <option> s. It works fine but it cant use spaces in values! so it just returns the first word. for example, if the jresults.name is "lets go" - I get only "lets". What is the best way doing this? This part: $( "#prod_name_list" ).children().remove(); prevents me of choosing an option from the list. because it deletes everything in it when I "keyup" so I need a different solution for this. The