0

Example:

I have string "Waheed" so when try to search with small letters as "waheed" the results are not coming but when I search case it is working fine.. so how can I make it not case sensitive..? The table data is coming from php loop so iIcan not change it to lower or uppercase..! And this is my Javascript code:

$("#searchStudent").on("keyup", function() {        
    var value = $(this).val();      
    if(value!='') {         
        $("table tbody tr").hide();         
        }else{          
        $("table tbody tr").show();         
    }       
    $('table tbody tr td:contains("'+value+'")').parent('tr').show();       
}); 
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mr world wide
  • 4,696
  • 7
  • 43
  • 97

1 Answers1

1
$("#searchStudent").on("keyup", function() {        
var value = $(this).val();      
if(value!='') {         
    $("table tbody tr").hide();         
    }else{          
    $("table tbody tr").show();         
}       
$('table tbody tr td:contains("'+ value.charAt(0).toUpperCase() + value.slice(1) +'")').parent('tr').show();       
}); 

maybe try something like this

LiverpoolOwen
  • 806
  • 2
  • 10
  • 25