How we can select the submenu from parent list item only and not from child list item?
I have top-menu id which is first ul. Inside i have lots of li with ul (class sub-menu). Inside the submenu I am having different li which is also having li with same class (sub-menu).
This is the structure
<div id="#top-menu">
<li>
<ul class="sub-menu"> //need to select this only
<li>
<ul class="sub-menu"> // Not this
</li>
</li>
<li></li>
<li></li>
<ul class="sub-menu">
<li></li>
<ul class="sub-menu">
<li></li>
<li></li>
<li></li>
</div>
<ul>
s are not closed, this is invalid HTML. – halfer