Skip to content

lorecioni/autocomplete.js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Autocomplete.js

A jQuery plugin for search hints

Autocomplete.js is a jQuery plugin that improve your search with hints.

Getting started

Make sure jQuery is included in your page, than include autocomplete.js and autocomplete.css inside the head tag.

<script src=https://github.com/lorecioni/"js/autocomplete.min.js"> </head>">
<head>
	<link rel="stylesheet" type="text/css" href="css/autocomplete.min.css"/>
	<script src="js/autocomplete.min.js"></script>
</head>

At least fill hints and call the plugin on selected HTML element

To add an Animotion programmatically:

var words = ['boat', 'dog', 'drink', 'elephant', 'fruit', 'London'];

$(document).ready(function(){
	$('#yourElement').autocomplete({
		hints: words
	});
});

Options

  • hints: words array for displaying hints.
  • placeholder: search input placeholder (default: 'Search').
  • width: input text width.
  • height: input text height.
  • showButton: display search button (default: true).
  • buttonText: button text (default: 'Search').
  • onSubmit: function handler called on input submit.
  • onBlur: function handler called on input losing focus.
  • height: input text height.

Demo

To view a simple demo click here

License

Autocomplete.js is licensed under the MIT license. (http://opensource.org/licenses/MIT)

Contributing

Pull requests and feedbacks are welcome here!