title: Jquery select clicked element within a set of elements with the same classname
body: <p>Maybe you guys can help me out with this, I've been struggling with it for the past 30 minutes.  </p>
  
  <p>Let's say I have four elements with the same class.  </p>
  
  <pre><code>&lt;div class="test"&gt;hi&lt;/div&gt;
  &lt;div class="test"&gt;hey&lt;/div&gt;
  &lt;div class="test"&gt;yo&lt;/div&gt;
  &lt;div class="test"&gt;What's up&lt;/div&gt;
  </code></pre>
  
  <p>How can I select the one that was clicked on?</p>
  
  <p>I was able to get it work like this:</p>
  
  <pre><code>$('.test').click(function() {
      $(this).toggleClass("btn-danger btn-success");
  });
  </code></pre>
  
  <p>However, I need it to fire without being clicked on success after an ajax call, so I need to be able to do something like this (failed attempts): </p>
  
  <pre><code>$('.test', this).toggleClass("btn-danger btn-success"); // This did not work
  
  $(this).find('.test').toggleClass("btn-danger btn-success");  // Also did not work
  </code></pre>
  
  <p>Any suggestions?  Thanks so much!!</p>