JSFiddle - React, Tailwind, and code Playground

HTML

<input id="ac">

JavaScript

var acList = ['smart',
'oversmart',
'smartland',
'undersmart',
'verysmart'
];
$('#ac').autocomplete({
  source: function( request, response ) {
    var matches = $.map( acList, function(acItem) {
      if ( acItem.toUpperCase().indexOf(request.term.toUpperCase()) === 0 ) {
        return acItem;
      }
    });
    response(matches);
  }
});