title: Bootstrap collapse not working properly
body: <p>I have created an accordion with bootstrap collapse. There are certain elements in accordion that alternate on expansion on click of the particular element. The following markup is created:</p>
  
  <pre><code>    &lt;div class="accordion" id="accordion2"&gt;
  
          &lt;div class="accordion-group"&gt;
              &lt;div class="accordion-heading"&gt;
                  &lt;a class="accordion-toggle" href="#collapse-0" id="0" data-toggle="collapse" data-parent="#accordion2"&gt;
                     User Visits
                  &lt;/a&gt;
              &lt;/div&gt;
              &lt;div id="collapse-0" class="accordion-body collapse in"&gt;
                  &lt;div class="accordion-inner"&gt;
                      Collapsible &lt;br/&gt;
                      Collapsible &lt;br/&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="accordion-group"&gt;                   
              &lt;div class="accordion-heading"&gt;
                  &lt;a class="accordion-toggle" href="#collapse-1" id="1" data-toggle="collapse" data-parent="#accordion2"&gt;
                      Points
                  &lt;/a&gt;
              &lt;/div&gt;                  
              &lt;div id="collapse-1" class="accordion-body collapse"&gt;
                  &lt;div class="accordion-inner"&gt;
                      Collapsible &lt;br/&gt;
                      Collapsible &lt;br/&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>The problem is that after the page loads the first click on a particular element results in successful expansion of the <code>.accordion-body .collapse</code> block but successive calls do not result into any expansion.</p>
  
  <p>The expansion results due to addition of a class called <code>in</code> dynamically. Even on the successive clicks on accordion elements the inspection shows the flipping of the <code>in</code> class as it should be but in spite of that the element doesn't expand. </p>
  
  <p>Please suggest what could be the problem.</p>