I have the following:
item1 sub1 sub2
Another way to achieve same
$("#list li").click(function() { alert($(this).contents().not('ul,ol').text()); });