JSFiddle - React, Tailwind, and code Playground
JavaScript
$("#hotelNameKey").focus(function(){
var inputKey = $('#hotelNameKey').val();
if(inputKey){
$(".myautocomplete").show();
return;
}else{
$(".myautocomplete,.rightIcon").hide();
}
});