问题
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