SHARE
TWEET

Untitled

a guest Aug 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $("#filter").keyup(function() {
  2.  
  3.         console.log("keyup");
  4.         // Retrieve the input field text and reset the count to zero
  5.         var filter = $(this).val(),
  6.             count = 0;
  7.  
  8.         // Loop through the comment list
  9.         $('.row .base div').each(function() {
  10.  
  11.  
  12.             // If the list item does not contain the text phrase fade it out
  13.             if ($(this).text().search(new RegExp(filter, "i")) < 0) {
  14.                 $(this).hide();  // MY CHANGE
  15.  
  16.                 // Show the list item if the phrase matches and increase the count by 1
  17.             } else {
  18.                 $(this).show(); // MY CHANGE
  19.                 count++;
  20.             }
  21.  
  22.         });
  23.  
  24.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top