jQuery & jQueryUI Base
HTML
<link rel="stylesheet" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.7/themes/black-tie/jquery-ui.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.7/jquery-ui.min.js"></script>
<script src="http://cloud.github.com/downloads/digitalBush/jquery.maskedinput/jquery.maskedinput-1.3.min.js"></script>
<input type="text" id="autocomplete" />
<div id="results"></div>
JavaScript
$("#autocomplete").autocomplete({
source: ['Java', 'JavaScript', 'C', 'C#', 'C++'],
appendTo: "#results",
open: function() {
var position = $("#results").position(),
left = position.left, top = position.top;
$("#results > ul").css({left: (left + 20) + "px",
top: (top + 4) + "px" });
}
});