jquery - how to slice elements in two different unordered lists?
<p>I have two sets of unordered lists with the same class name and I want to subset it with jquery slice.</p>

<pre><code>var currentCount= 0;
var maxCount= 3;
$('.ulClassName&gt;li').slice(currentCount,maxCount).show();
</code></pre>

<p>This works perfectly for the first UL (it shows only the first three lists) but does not slice the second UL with the same class name. Below is the markup:</p>

<pre><code>&lt;ul class="ulClassName" id="firstUL"&gt;
 &lt;li&gt;Blah blah1 &lt;/li&gt;
 &lt;li&gt;Blah blah2 &lt;/li&gt;
 &lt;li&gt;Blah blah3 &lt;/li&gt;
 &lt;li&gt;Blah blah4 &lt;/li&gt;
 &lt;li&gt;Blah blah5 &lt;/li&gt;
 &lt;li&gt;Blah blah6 &lt;/li&gt;
&lt;/ul&gt;
&lt;ul class="ulClassName" id="secondUL"&gt;
 &lt;li&gt;Blah blah1 &lt;/li&gt;
 &lt;li&gt;Blah blah2 &lt;/li&gt;
 &lt;li&gt;Blah blah3 &lt;/li&gt;
 &lt;li&gt;Blah blah4 &lt;/li&gt;
</code></pre>

<p></p>

<p>I understand that jquery indexes all list elements in the page, I dont want to write separate code for the two lists, can somebody help me?</p>
