title: Searching in jquery
body: <p>I have some boxes div class and I would like when the users enter anything in the search box, it will display those boxes and those boxes only (filters it). The current code will remove all the boxes before displaying what the user enters in the searchbox. Thanks!</p>
  
  <pre><code>&lt;!-- Search box --&gt;
  &lt;input type="text" id="txt_name"  /&gt;
  &lt;!-- Search button--&gt;
  &lt;input type="button"  id="searchTest" value="Search"/&gt;
  
  
  &lt;!-- Searching for the ID that the user enter --&gt;
  &lt;script language='JavaScript' type='text/JavaScript'&gt;
  
  $('#searchTest').click(function() {
  
      // removes all the div class before displaying the results
      $('div[id*=ID_]').css('display', 'none');
  
      //display only whatever the user's entered
          $('div[id*=ID_]').filter(bla).css('display', 'block');
      });
  
      &lt;/script&gt;
  
  
  
      &lt;!-- Test boxes that needs filtering--&gt;
      &lt;div class="color1" id="USEID_company1_user1_Location1"&gt;
          &lt;p&gt; test&lt;/p&gt;
      &lt;/div&gt; 
  
      &lt;div class="color2" id="USEID_company2_user2_Location2"&gt;
          &lt;p&gt; test&lt;/p&gt;
      &lt;/div&gt; 
  </code></pre>