Use HTML5 (datalist) autocomplete with 'contains' approach, not just 'starts with'

前端 未结 4 735
清歌不尽
清歌不尽 2020-11-29 05:03

(I can\'t find it, but then again I don\'t really know how to search for it.)

I want to use and

4条回答
  •  半阙折子戏
    2020-11-29 05:59

    this fiddle here has cracked what you are asking for But I am not sure how to make it work without this dependency as the UI looks bit odd and out of place when used along with Bootstrap.

     elem.autocomplete({
        source: list.children().map(function() {
            return $(this).text();
        }).get()
    

提交回复
热议问题