A simple jquery ui autocomplete

by adamovic

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css">
<div class="ui-widget">
<label for="tags">Search: </label>
<input id="tags">
</div>

JavaScript

$(function() {
var availableTags = [
"john",
"john2",
"iohn3",
"john4",
"john white",
"johnny"
];
$( "#tags" ).autocomplete({
source: availableTags, 
autoFocus: true
});
});