Hi there, This will work with jQuery 1.2+:
$('ul.mylist ul:not(:has(.active))').hide(); --Karl _________________ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct 7, 2007, at 4:46 PM, [EMAIL PROTECTED] wrote:
Could someone help me out with the following problem. I've been thinking about this for quite a while, but I just cannot think of a solution to the problem at all. Quite simply, I would like to leave the UL containing the LI with class="active" open when the page is loaded, all other elements should just display the heading, but not the individual list items: <ul class="mylist"> <li>heading 1 <ul> <li class="active">item</li> <li>item</li> </ul> </li> <li>heading 2 <ul> <li>item</li> </ul> </li> <li>heading 3 <ul> <li>item</li> </ul> </li> </ul> Thanks for your help!