title: Filter Results in Jquery on list
body: <p>I downloaded and edited a code that from internet, basically what I want to do is to create a list of strings that I'm reading from the database using JSON.
  The list is built perfect, now what I want to do is to filter results (text box) using Jquery.
  What's the best way to do that?
  Show the full list of results when users type something in a textbox filter those results in the list.</p>
  
  <p>Thanks</p>
  
  <pre><code>$(function ()
  {
      $.ajax({
          url: 'api.php', data: "", dataType: 'json',  success: function(rows)
          {
              var list = $("#toggle").append('&lt;ul&gt;&lt;/ul&gt;').find('ul');
              for (var i in rows)
              {
              var row = rows[i];
                  //var id = row[0];
                  var Dname = row[4];
                  Dname = Dname.toLowerCase();
                  list.append("&lt;li&gt;"+Dname+"&lt;/li&gt;&lt;div&gt;Pulse&lt;/div&gt;");
              }
              $('ul li:odd').addClass('zebra_odd');
              $('ul li:even').addClass('zebra_even');
              $("li").click(function(){
                  $(this).toggleClass("active");
                  $(this).next("div").stop('true','true').slideToggle();
              });
          }
      });
  });
  </code></pre>