-1
Good morning!
I have this code that searches inside a list <ul> <li>
:
$(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 take the case sensitive of jquery in the search, doing a search by google found this code:
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
But I didn’t quite understand it, someone has something clearer on the subject, or if there’s some other way to get the case sensitive?
Thank you, but if you have something to read, too, on the subject, thank you.
– Wagner Viana
For further reading you have Mozilla documentation on uppercase https://mzl.la/2bJXuuT and about string manipulation has this link https://mzl.la/2bPBxHX
– Kirmayr Tomaz
Thanks again
– Wagner Viana