[jQuery] How to determine if a node is a leaf node
I have a list like,
<li>1</li>
<li>2
<ul>
<li>2.1
</li>
</ul>
</li>
<li>3
<ul>
<li>3.1
</li>
</ul>
</li>
I want to get handle to nodes with 1, 2.1 and 3.1, as they are the
nodes with no children. How can I do this?