Skip to content

Instantly share code, notes, and snippets.

@nmfzone
Last active August 29, 2015 14:21
Show Gist options
  • Save nmfzone/d9fbb670a76b57011a37 to your computer and use it in GitHub Desktop.
Save nmfzone/d9fbb670a76b57011a37 to your computer and use it in GitHub Desktop.
OVXMwG
<label><p><b>Start typing a name in the input field below:</b></p></label>
<div id="code">
<form>
<input type="text" id="auto">
</form>
<div id="results"></div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="//io.nmfzone.com/js/jquery-autocomplete.min.js"></script>
$(function(){
var availableData = [
{
value: "ActionScript"
},
{
value: "AppleScript"
},
{
value: "Asp"
},
{
value: "BASIC"
},
{
value: "C"
},
{
value: "C++"
},
{
value: "Clojure"
},
{
value: "COBOL"
},
{
value: "ColdFusion"
},
{
value: "Erlang"
},
{
value: "Fortran"
},
{
value: "Groovy"
},
{
value: "Haskell"
},
{
value: "Java"
},
{
value: "JavaScript"
},
{
value: "Lisp"
},
{
value: "Perl"
},
{
value: "PHP"
},
{
value: "Python"
},
{
value: "Ruby"
},
{
value: "Scala"
},
{
value: "Scheme"
}
];
$('#auto').autocomplete({
lookup: availableData,
onSelect: function (datas) {
var thehtml = datas.value;
$('#results').html(thehtml);
}
});
});
#code, form, #results {
float: left;
}
#resutls {
color: #000;
font-size: 17px;
padding-left: 50px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment