jquery realization table search

$('tr').each(function(){
        vat text = $ ( "# text"); // search for content
        if (text! = "All") {
            $ (This) .css ( 'display', 'none'); // hide all first tr
            // determine the second column "td: eq (1)" contains a search content
            if($(this).find("td:eq(1)").html().indexOf(text)>=0){
                $ (This) .show (); // displays the searched part   
            }
        }else{
              $ (This) .show (); // display all content
        }
});

Guess you like

Origin www.cnblogs.com/aj407blogs/p/10979153.html