JSFiddle - React, Tailwind, and code Playground
HTML
<input id="autocomplete"/> <input id="submit" type="submit" disabled="disabled"/>
JavaScript
var source = ['One', 'Two', 'Three', 'Four'];
$("input#autocomplete").autocomplete({
source: source,
select: function(event, ui) {
$("#submit").removeAttr("disabled");
}
}).change(function() {
var $parentContext = $(this);
var matches = $.grep(source, function(n, i) {
return $parentContext.val().toLowerCase() == n.toLowerCase();
});
$("#submit").attr("disabled", !matches.length);
});