JAVASCRIPT AUTOCOMPLETION LIBRARY

Demos - API - Reviews - Download - About
complete.ly
A javascript library for autocompletion. For a wonderful user experience.
autocompletion javascript library
image: complete.ly.jpg
Demos
Each example has its own HTML page. Check the source code to see how it works.

a different travel booking
web browser console
clauses
crayola colors
draw a robot

Use the code playground to try it out

API
complete.ly is an open source javascript library (MIT License). It has no dependencies, no CSS, no built-in ajax and an Occam's Razor API. It pollutes your global scope with the variable 'completely' and works on any desktop modern browser.

var c = completely(HTMLElement parentNode,[object config] )
Creates the compound HTML element for auto-completion
c.options = ['apple', 'apricot', 'banana', 'cherry', 'coconut', ... 'strawberry', 'watermelon'];
The elements - typically ordered alphabetically - to choose from.
c.startFrom = 0;
The index - position in the text - from which to work the matching
c.setText('apricot'); c.getText(); // returns apricot
Accessor and modifier for the underlying text/string.
c.onChange = function(txt) { // a good place to update // the array of options ... }
Callback function - invoked any time the text in completely changes.
c.repaint();
Forces a repaint
c.hideDropDown();
Hides the dropdown if visible
// For no-big-deal hacking c.wrapper c.prompt c.input c.hint c.dropDown
The underlying HTML elements
Reviews

“Completely awesome (Nick Pettit)” - video from teamtreehouse.com and blog - Oct 2013

“I like how it fills it in in the box itself rather than always in a dropdown like most autocomplete” - pineapple.io - Sep 2013

“I saw it this morning and thought about it all day” - a user on echojs - Sep 2013

“Une bibliothèque JS pour auto-compléter des champs de manière originale (french site)” - la ferme du web - Sep 2013

“An interesting JavaScript library for auto-completion” - codrops - Sep 2013

“библиотека для реализации автозаполнения полей (russian site)” - habrahabr.ru - Sep 2013

“a JavaScript library for adding autocomplete functions to your website” - codegeekz.com - Sep 2013

“a fresh take on autocompletion for a wonderful user experience” - onextrapixel - Sep 2013

“autocompletion with no dependencies” - flippin awesome - Sep 2013

and more codevisually - splashnology - jquer.in - javascript weekly - cssauthor - webification ...

Downloading complete.ly
Compressed and uncompressed copies of complete.ly files are available
complete.ly.1.0.1.min.js
complete.ly.1.0.1.js

About
complete.ly was written by me, Lorenzo Puccetti. It's a few hundred lines of javascript that I bundled together and carefully tested some time in Autumn 2013. It does the job and I recommend it unless you are google or amazon and you can do a better job in-house.