Good morning!
I have this code that does the search within a <ul> <li>
list:
$(function(){
$('input[type="text"]').keyup(function(){
var searchText = $(this).val();
$('.filter-task > li').each(function(){
var currentLiText = $(this).text(),
showCurrentLi = currentLiText.indexOf(searchText) !== -1;
$(this).toggle(showCurrentLi);
});
});
});
I'm trying to get the case sensitive from jquery in the search, doing a search by google I found this code:
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
But I do not quite understand it, does anyone have something clearer on the subject, or do you have any other way to get the case sensitive?