<input type=“search”> and jQuery Autocomplete

亡梦爱人 提交于 2020-01-05 15:05:08

问题


Once i change the type of the <input> element to the html5 type search, jQuery's Autocomplete functionality just won't work anymore.

I use jQuery Mobile, and i am trying to use the "search" input type with jQuery UI Autocomplete


回答1:


It's because the jQuery UI Autocomplete select only elements with type="text"

Have you tried to attach the Autocomplete to the elements with id selector?




回答2:


Using:

<input type="text" data-type="search" />

will give the same visual results as

<input type="search" />

But the autoComplete plugin will still work, also broken with type="search", https://github.com/commadelimited/autoComplete.js

Might also fix jQuery UI Autocomplete?



来源:https://stackoverflow.com/questions/9173104/input-type-search-and-jquery-autocomplete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!