title: Jquery $(this) Child Selector
body: <p>I'm using this:</p>
  
  <pre><code>jQuery('.class1 a').click( function() {
    if ($(".class2").is(":hidden")) {
      $(".class2").slideDown("slow");
    } else {
      $(".class2").slideUp();
    }
  });
  </code></pre>
  
  <p>On page structure:</p>
  
  <pre><code>&lt;div class="class1"&gt;
    &lt;a href="..."&gt;text&lt;/a&gt;
    &lt;div class="class2"&gt;text&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>It only works when you don't have multiple class1/class2 sets like:</p>
  
  <pre><code>&lt;div class="class1"&gt;
    &lt;a href="..."&gt;text&lt;/a&gt;
    &lt;div class="class2"&gt;text&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="class1"&gt;
    &lt;a href="..."&gt;text&lt;/a&gt;
    &lt;div class="class2"&gt;text&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="class1"&gt;
    &lt;a href="..."&gt;text&lt;/a&gt;
    &lt;div class="class2"&gt;text&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How do I change the initial jquery code so that it only effects class2 under the class1 that was clicked? I tried recommendations from <a href="https://stackoverflow.com/questions/306583/jquery-this-selector-and-children">How to get the children of the $(this) selector?</a> but haven't succeeded.</p>