JavaScript autocomplete without external library

后端 未结 6 2081
面向向阳花
面向向阳花 2020-12-23 11:33

Is there a javascript autocomplete library that does not depend on any other libraries?

I am not using jQuery or the likes as I am making a mobile app that I need to

6条回答
  •  旧时难觅i
    2020-12-23 11:50

    For anyone looking at this in 2017 onwards who needs a simple solution, you can use HTML5's built-in tag instead of relying on JavaScript.

    Example:

    
      
    
    
    

    Note that this won't work in Safari (as of April 2017).

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist

提交回复
热议问题