JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<input id="ac" type="text" />
JavaScript
$('#ac').autocomplete({
minLength: 0,
autoFocus: true,
delay: 1000,
source: function(req, resp) {
var terms = ["Hello", "Hallo", "Bonjour"],
result = [];
terms.forEach(function(term) {
if(term.indexOf(req.term) === 0)
{
result.push(term);
}
});
resp(result);
}
}).bind({
keydown: function(e) {
if(e.which === 13)
{
$(this).val("");
}
}
});