jquery实现页面的搜索功能

 1 $(function(){
 2     $("input[type=button]").click(function(){
 3       var txt=$("input[type=text]").val();
 4       if($.trim(txt)!=""){
 5  
 6         $("table tr:not('#theader')").hide().filter(":contains('"+txt+"')").show().css("background","red");
 7       }else{
 8         $("table tr:not('#theader')").css("background","#fff").show();
 9       }
10     });
11   })
原文地址:https://www.cnblogs.com/yangguoe/p/9045225.html