<ul class="submenu">
<li><a href="...">Submenu 3</a></li>
<li><a href="..." >I need to select this element</a>
<ul class="submenu">
<li><a href="...">Sub-submenu 3</a></li>
<li><a href="...">I need to select this element</a>
<ul class="submenu">
<li><a href="...">Sub-sub-sub 1</a></li>
<li><a href="...">Sub-sub-sub 2</a></li>
基本上,我需要选择<li>
位于( 's parent)ul
元素之前的每个元素class="submenu"
ul class="submenu"
我需要选择这个元素