I need to select only the leaf link elements of a nested list
Sample HTML
<ul>
<li>folder
<ul>
<li>><a class="t-link" href="">folder</a>
<ul>
<li><a class="t-link" href="">leaf 1</a><li>
<li><a class="t-link" href="">leaf 2</a><li>
</ul>
</li>
</ul>
</li>
</ul>
So in this example I want to select the two leaf links but not the folder link
The folders can be nested infinitely deeply (but typically only 2-3 levels). I figure I need to look for li elements that don’t contain ul elements but I can’t see how you do that in jQuery
This will select the leaf nodes that do not have other unordered lists as children:
Quick jsFiddle with color coded example: http://jsfiddle.net/rFuUc/