check if a "div" contains other elements
<p>I'm building dynamically an <code>UL &gt; LI &gt; a</code> structure, I want to check if on click event there are many other nodes.</p>

<p>I try this:</p>

<pre><code>jQuery('ul.sub-menu li a').click(function(){
    if(jQuery(this).has('.sub-menu').length &gt; 0)
        return false;
});
</code></pre>

<p>but doesn't work!</p>
