title: how to do something if an element has siblings
body: <p>i have an unordered list as a left nav with quite a few links in it. most of the list items have another unordered list as a submenu associated with them. however, a few of the links have no submenus. i want to disable the default click behavior on the links that have submenus so i can have the submenu animate open. but on the links with no submenu i need to have the link clickable. 
  the javascript i have to do this is:</p>
  
  <pre><code>$(function(){
      if($("#leftNav ul:first &gt; li &gt; a").siblings().size() &gt; 0){
          $("#leftNav ul:first &gt; li &gt; a").click(function(e){
              e.preventDefault();
          });
      }   
  </code></pre>
  
  <p>the problem is that this disables the default click behavior for all the links, not just the ones with siblings.
  the html for the left nav looks like this</p>
  
  <pre><code>&lt;div id="leftNav"&gt;
      &lt;ul&gt;
          &lt;li&gt;
              &lt;a href="#"&gt;Link 1&lt;/a&gt;
              &lt;ul&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Submenu Link 1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Submenu Link 2&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Submenu Link 3&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
       &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>so the click behavior would need to be removed on Link 1 because it has the <code>&lt;ul&gt;</code> as a sibling. Link 2 has no siblings so it should be left alone.</p>