title: JQuery: How to select a class without elements of a parent with id?
body: <p>I have a <code>ul</code> element:</p>
  <pre><code>&lt;ul id=&quot;listA&quot;&gt;
    &lt;li class=&quot;myclass&quot;&gt;1&lt;/li&gt;
    &lt;li class=&quot;myclass&quot;&gt;2&lt;/li&gt;
    &lt;li class=&quot;myclass&quot;&gt;3&lt;/li&gt;
    &lt;li class=&quot;myclass&quot;&gt;4&lt;/li&gt;
    &lt;li class=&quot;myclass&quot;&gt;5&lt;/li&gt;
    &lt;li&gt;
      &lt;ul id=&quot;listB&quot;&gt;
        &lt;li class=&quot;myclass&quot;&gt;B1&lt;/li&gt;
        &lt;li class=&quot;myclass&quot;&gt;B2&lt;/li&gt;
        &lt;li class=&quot;myclass&quot;&gt;B3&lt;/li&gt;
        &lt;li class=&quot;myclass&quot;&gt;B4&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>I want to get all elements by class name <code>myclass</code> which are not in <code>ul</code> with ID <code>listB</code>.</p>
  <p>My tries with <code>$('.myclass:not ul #listB')</code> wont work.</p>