title: How to open and collapse the same JQuery accordion with click on it only
body: <p>Trying to get the accordion open and collapse <strong>only</strong> when it's being clicked. I am able to open/collapse it but it is getting closed <strong>also</strong> when another accordion is clicked.</p>
  
  <p>It should open or close on its own - independently from other accordions.</p>
  
  <p>This is what I have tried.</p>
  
  <p>JS:</p>
  
  <pre><code>$(document).on("click", ".accordion-toggle", function () {
          if ($(this).attr('class').indexOf('open') == -1)
     $(this).toggleClass("open").next().slideToggle('fast');
          //Hide the other panels
          $(".accordion-toggle").not($(this)).removeClass("open");
          $(".accordion-content").not($(this).next()).slideUp('fast');
      });
  </code></pre>
  
  <p>Fiddle:
  <a href="http://jsfiddle.net/8yap08dc/" rel="nofollow noreferrer">Demo</a></p>