https://github.com/useallfive/type-ahead
A very barebones, entirely javascript autocomplete. Doesn't require jQuery.
https://github.com/useallfive/type-ahead
Last synced: about 1 year ago
JSON representation
A very barebones, entirely javascript autocomplete. Doesn't require jQuery.
- Host: GitHub
- URL: https://github.com/useallfive/type-ahead
- Owner: UseAllFive
- Created: 2013-08-12T17:28:52.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-08-17T00:31:45.000Z (almost 13 years ago)
- Last Synced: 2024-12-20T07:07:38.462Z (over 1 year ago)
- Language: JavaScript
- Size: 289 KB
- Stars: 1
- Watchers: 26
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Type Ahead
=============
A very barebones, entirely javascript type ahead/auto-completer. Doesn't require jQuery.
You simply pass it a hidden field and an array. Add your own styles.
Demo: http://useallfive.github.io/type-ahead/demo/typeahead-usage.html
### Usage:
```HTML
var data = [
{'name': 'dog', 'value':1},
{'name': 'cat', 'value':2},
{'name': 'cats', 'value':3}
];
var opts = {
//-- Prefix is a string added before
// all of the css selectors added to elements:
'prefix': 'ua5_typeahead_',
//-- HTML5 Placeholder text that shows up in the input
'placeholder': 'Search Array',
//-- Set to false by default. If true searching
// for 'cat' will not return 'Cat'
'match_case': false
}
var t = TypeAhead(document.getElementById('test'), data, opts);
```