JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="searchFAQ">
JavaScript
$(document).ready(function() {
var timer, searchInput;
$('#searchFAQ').keyup(function() {
clearTimeout(timer);
timer = setTimeout(function() {
searchInput = $('#searchFAQ').val().match(/\w+/g);
if(searchInput) {
for (var elem in searchInput) {
if (searchInput[elem].length < 4) {
//remove those entries
searchInput.splice(elem, 1);
}
}
console.log(searchInput);
}
}, 500);
});