[jQuery] Add a class to all the LIs without a children UL

[jQuery] Add a class to all the LIs without a children UL


I have a nested UL/LI structure where the root UL has id="tree" and i
have to select all the LIs that don't have a children ul to apply to
them a class called 'leaf'.
I tried:
$('#tree li>:not(ul)').addClass('leaf');
$('#tree li:([ul])').addClass('leaf');
Could someone help me?