var text = "";
//實時篩選,不用點擊按鈕
setInterval(function(){
text = $('#input').val();//獲取文本框輸入
if($.trim(text) != ""){
$("#ulId li:not('#theader')").hide().filter(":contains('"+text+"')").show();
}else{
$('#ulId li').show();//當刪除文本框的內容時,又重新顯示錶格所有內容
}
},100);
}
原文:
- var text = "";
- //實時篩選,不用點擊按鈕
- setInterval(function(){
- text = $('#input').val();//獲取文本框輸入
- if($.trim(text) != ""){
- $("#table tr:not('#theader')").hide().filter(":contains('"+text+"')").show();
- }else{
- $('#table tr').show();//當刪除文本框的內容時,又重新顯示錶格所有內容
- }
- },100);
- var text = "";
- //實時篩選,不用點擊按鈕
- setInterval(function(){
- text = $('#input').val();//獲取文本框輸入
- if($.trim(text) != ""){
- $("#table tr:not('#theader')").hide().filter(":contains('"+text+"')").show();
- }else{
- $('#table tr').show();//當刪除文本框的內容時,又重新顯示錶格所有內容
- }
- },100);