title: jQuery - rule for "does not contain element"
body: <p>I want to create a rule to target the <code>a</code> element in the following:</p>
  
  <pre><code>&lt;ul id="root"&gt;
     &lt;li&gt;
        &lt;a href="item.html"&gt;Root Menu Item&lt;/a&gt;
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>However this should not apply if the <code>li</code> element contains another <code>ul</code> element, e.g:</p>
  
  <pre><code>&lt;ul id="root"&gt;
     &lt;li&gt;
        &lt;a href="#"&gt;Sub Menu&lt;/a&gt;
        &lt;ul&gt;
           &lt;li&gt;
              &lt;a href="item.html"&gt;Sub Menu Item&lt;/a&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I have created the event as required but need it to only work on the "root" menu items.</p>
  
  <p>I know I can just add an id attribute to target the desired element only but the menu plugin that my client has installed is not easily configurable.</p>