1
테이블이 있습니다. id = "menu_list_comparisons"간단한 쿼리 테이블 다중 검색 필터
두 개의 입력 필터가 있습니다. 하나는 이름이고 다른 하나는 lang입니다.
이름을 검색하려고하면 작동합니다.
내가 랭을 검색하려고하면 작동합니다.
믹스를 원한다면 작동하지 않습니다.
$("#kwd_search, #kwd_search_lang").keyup(function() {
또한 사용할 수 있습니다
<script>
$(document).ready(function(){
//function to filter the results by name
$("#kwd_search").keyup(function(){
var word=$(this).val()
if(word != ""){
$("#menu_list_comparisons tbody>tr").hide();
$("#menu_list_comparisons td").filter(function(){
return $(this).text().toLowerCase().indexOf(word) >-1
}).parent("tr").show();
}
else{
$("#menu_list_comparisons tbody>tr").show();
}
return false;
});
//function to filter the results by lang
$("#kwd_search_lang").keyup(function(){
var word=$(this).val()
if(word != ""){
$("#menu_list_comparisons tbody>tr").hide();
$("#menu_list_comparisons td").filter(function(){
return $(this).text().toLowerCase().indexOf(word) >-1
}).parent("tr").show();
}
else{
$("#menu_list_comparisons tbody>tr").show();
}
return false;
});
});
</script>
<div style="width: 100%; text-align: center;"><br /><label for="kwd_search">Search:</label> <input type="text" id="kwd_search" value=""><label for="kwd_search_lang">Language:</label> <input type="text" id="kwd_search_lang" value=""></div>
선택기를 어떻게 조합하고 있습니까? –