title: jquery: exclude children
body: <p>I know this has been asked numerous times, and I have tried all the suggestions, and read all about varying selectors, and etc. but nothing is working for me</p>
  
  <p>given the following piece of HTML:</p>
  
  <pre><code>&lt;div class="class1"&gt;
    &lt;p&gt;
     &lt;a&gt;link&lt;/a&gt;
    &lt;/p&gt;
    &lt;div class="class2 class3"&gt;
      &lt;p&gt;
        &lt;font&gt;
          &lt;a&gt;link2&lt;/a&gt;
        &lt;/font&gt;
      &lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I want to select the first div's &lt;a&gt; tag, but nothing from the second div</p>
  
  <p>I have tried:</p>
  
  <pre><code>$('.class1').not('.class2, .class3')
  $('.class1').not('.class2')
  $('.class1').not('.class3')
  $(".class1:not(.class2)")
  $(".class1:not(.class3)")
  $(".class1:not(.class2, .class3)")
  $("div.class1:not(.class2)")
  $("div.class1:not(div.class2)")
  $("div.class1:not(div.*)")
  </code></pre>
  
  <p>etc.</p>
  
  <p>I don't know if it's because the second div has two class names, or because the second div's &lt;a&gt; tags are not direct children of the second div (e.g. there are font tags and such around them) but I am unable to exclude the second div.</p>