EDIT: I did more research on datalist and it seems that its matching behavior is not customizable. I decided to ditch datalist and made my own drop down list and autocomplete plugin.
I have a input datalist like this
<input list="Country" />
<datalist id="Country">
<option value="United States of America"/>
</datalist>
At the moment, the datalist will only show "United States of America" if the user types in the country name in order of the datalist option, ie. United states, states of, etc.
I want the datalist to show "United States of America" even if the user types in the name not in order, ie. United America, America States.
In PHP and MySQL, I can split the input into array of each individual word, and use LIKE %..% clause to query what I want.
How do I achieve that with Jquery or Javascript?