jquery - How to select an element which parent is not specified class? -


i want hide element if parent not have class:

html

<li class="current_page_parent">     <a href="parent.html">parent</a>     <ul class="children">         <li>foo</li>         <li>bar</li>     </ul> </li> 

jquery

jquery("ul.children").hide(); 

currently hides <ul class="children"> regardless of class. close if parent :not <li class="current_page_parent">.

i've tried:

jquery("ul.children:not(:parent.current_page_ancestor)").hide(); 

with no luck.

try this:

jquery("li:not(.current_page_parent) ul.children").hide(); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -