Clear text box in Jquery Autocomplete after selection
问题 I want to clear the textbox having Jquery Autocomplete once the user has made the selection. I tried to clear the field by : select: function(event, ui) { $(this).val(''); } But this is not working.I am using jquery-1.6.4 and jquery-ui-1.8.16. Any Ideas? 回答1: The select event occurs before the field is updated. You will have to cancel the event to avoid the field being updated after you have cleared it: select: function(event, ui) { $(this).val(""); return false; } Update: As T.J. pointed out