I have this layout:
<div class="list">
<ul></ul>
<ul></ul>
</div>
<div class="list">
<ul></ul>
<ul></ul>
<ul></ul>
<ul></ul>
</div>
<div class="list">
<ul></ul>
<ul></ul>
</div>
I am trying to only show the first ul of every div using jQuery. I know it is possible but when using $('div.list ul:gt(1)').each(function(){$(this).hide()}); it shows the first div’s contents and hides everything else.
Fiddle: http://jsfiddle.net/y9bEG/3/
Use this:
It selects each
divelement with classlist, and hides all<ul>elements which are not a first element.