I have a list in HTML. There are several nested ul and li.When I click on a li, I want to find a deepest item in that li tag that has no ul tag inside and the li is the last
Something like this should do the trick...
$('.liclk').click(function() { var el = $(this).find("ul:last-child").find('li:last-child').css("background-color", "red"); });