title: How add "active" class to open Bootstrap 3 accordion item?
body: <p>How can I add "active" class to open Bootstrap 3 accordion item? In my example id adds "active" but does't remove from other elements. I'm using Bootstrap 3 </p>
  
  <pre><code>&lt;div class="panel-group accordions" id="accordion1"&gt;
      &lt;div class="panel panel-custom"&gt;
          &lt;div class="panel-heading"&gt;
              &lt;h4 class="panel-title"&gt;
                  &lt;a data-toggle="collapse" data-parent="#accordion" href="#collapse1"&gt;
                      Collapsible Group Item #1
                  &lt;/a&gt;
              &lt;/h4&gt;
          &lt;/div&gt;
          &lt;div id="collapse1" class="panel-collapse collapse in"&gt;
              &lt;div class="panel-body"&gt;
                  ....
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      ... 
  &lt;/div&gt;
  
  
   jQuery('.accordions .panel-heading a[data-toggle="collapse"]').on('click', function () {   
      $('.accordions').find(jQuery('.panel-heading a[data-toggle="collapse"]')).removeClass('actives');
      $(this).addClass('actives');
   });
  </code></pre>