I have a nested menu like this:
<ul id="menu">
<li>Home
<ul>
<li>New</li>
<li class="selected">Open</li>
<li>Folder</li>
</ul>
</li>
<li>Another menu
<ul>
<li>submenu item 1</li>
<li>submenu item 2</li>
<li>submenu item 3</li>
</ul>
</li>
</ul>
Now I'm trying to change the class of the first LI element (the one that contains Home), because it has a child element with a "selected" class. Is this possible using jQuery?