I have some nested <UL><li><ul><li>text</li></ul></li></UL>, I want to modify last child using jquery, but when I am writing $(“#id li:last-child”) it affecting all nested <li>s. here is the code.
<ul id="ddmenu">
<li><a href="#">Home></a>
<ul>
<li><a href="#">QA Managers Dashboard</a></li>
</ul>
</li>
<li><a href="#">Req Mgmt</a>
<ul>
<li><a href="#">Panel Beating</a></li>
<li><a href="#">Car Inspection</a></li>
</ul>
</li>
<li><a href="#">Test</a>
<ul>
<li><a href="#">Work Place</a></li>
<li><a href="#">Special Events</a></li>
</ul>
</li>
<li><a href="#">Project</a>
<ul>
<li><a href="#">Enquiry</a></li>
</ul>
</li>
<li><a href="#">More</a></li>
I want to modify the <li> which contains text “More”… how to do that?? any help please?
Use
>to get only direct descendants like this