title: jquery - Display only 15 list items in a UL
body: <p>I have a list that is generated by WordPress and I there is no way to limit how many tags to display through the function it self.</p>
  
  <p>With jQuery I decided to do this to display only the first 15:</p>
  
  <pre><code>$j(function(){
      if( $j('#popular-tags').length &gt; 0 ){
          var displayAmt = 15;
  
          var list = $j(this).find('ul');
          for(var i=1; i &lt;= displayAmt; i++ ){
              ....
          }
      }
  });
  </code></pre>
  
  <p>I'm a bit lost on how to iterate through each list item. But i have a class called <code>.not-display</code> that I want to add to the respective list item. I also wasn't sure if I need to use the <code>.each()</code> function that jQuery provides. </p>
  
  <p>Can someone enlighten me?</p>