简体   繁体   中英

Remove autocomplete dropdown options when the submit button is clicked

i used the jquery-ui autocomplete for my search bar. However, i noticed that whenever i type in something and click enter without choosing any of the options given by the autocomplete feature, the autocomplete dropdown words remainthere.

Is there a way that i can automatically close the autocomplete dropdown words when i click the submit button for my search bar?

$( ".selector" ).autocomplete( "close" ); use this code in the click function of the button...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM