Below is JavaScript I'm using for search query there is bug i have found which is issue with letter being caps or lower case. If the letters in list are lower case then it only searches for lower case but if you were to turn the caps on it doesn't find anything. Below are the codes i'm using any help will be appreciated.
HTML
<input type='search' id='search' placeholder='search'>
<ul>
<li>example 1</li>
<li>example 2</li>
<li>example 3</li>
</ul>
JavaScript
var search = $("#search");
var listItems = $("li");
search.on("keyup", function () {
var terms = search.val();
if (terms == '') {
listItems.show();
} else {
listItems.hide();
$("li:contains('" + terms + "')").show();
}
});