title: Adding And Removing Class on Active Accordion Toggle Element
body: <p>I have a Jquery Code for accordion and it's working well except I need to add/remove class on active trigger. What I mean is, when the H2 element is clicked, I need a class "accordion-toggled" added to it. The code shown here adds the class to all H2 elements when toggled and I only need it added to active H2. </p>
  
  <p>I could use some help on this.</p>
  
  <pre><code>$(document).ready(function(){
     $('div.accordion-content&gt; p').hide();  
     $('div.accordion-content&gt; h2').click(function() {
       $(this).next('p').slideToggle('fast')
       .siblings('p:visible').slideUp('fast');
       $('div.accordion-content&gt; h2').toggleClass('accordion-toggled');
     });
  });
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div class="accordion-content"&gt;
     &lt;h2&gt;Question 1&lt;/h2&gt;
     &lt;p&gt;Some answers for question 1&lt;/p&gt;
     &lt;h2&gt;Question 2&lt;/h2&gt;
     &lt;p&gt;Some answers for question 2&lt;/p&gt;
     &lt;h2&gt;Question 3&lt;/h2&gt;
     &lt;p&gt;Some answers for question 3&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>