autosuggest
Autosuggest values for text inputs
<input type="text">
autosuggest component. Try the demo!
Inspired from http://oak.cs.ucla.edu/cs144/projects/javascript/suggest1.html.
Installation
$ component install component/autosuggest
Example
var autosuggest = ;var input = document; // array of suggestionsvar suggestions = 'Sunday' 'Monday' 'Tuesday' 'Wednesday' 'Thursday' 'Friday' 'Saturday'; // create an `autosuggest` instancevar suggest = ; // and you can change the array of suggestions to use if they get changevar newSuggestions = suggestions;suggest;
API
autosuggest(el, [suggestions]) → Autosuggest
Returns an Autosuggest
instance. The instance has .start()
called on it if the
optional suggestions
array is given, otherwise you must call .set(array)
and
.start()
manually.
.stop()
Stops the autosuggesting.
License
MIT