title: Keep multiple collapse open (with button to toggle) – Bootstrap 3
body: <p>I'm trying to make it so that multiple accordions can be open at once, but then all of them can also be open/closed with a button in the navbar.</p>
  
  <p>The general advice seems to be to remove data-parent, which I've done, but there's still a conflict.</p>
  
  <p>Any help appreciated.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
     &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --&gt;
      &lt;title&gt;Well Placed&lt;/title&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
      &lt;link href="css/custom.css" rel="stylesheet"&gt;
      &lt;link href='https://fonts.googleapis.com/css?family=Open+Sans:700|Libre+Baskerville' rel='stylesheet' type='text/css'&gt;
     
    &lt;/head&gt;
  
    &lt;body&gt;
  
      &lt;nav class="navbar navbar-default navbar-fixed-top"&gt;
        &lt;div class="container"&gt;
          &lt;div class="navbar-header"&gt;
            &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"&gt;
              &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;/button&gt;
            &lt;a class="navbar-brand tk-brandon-grotesque" href="#"&gt;Well Placed&lt;/a&gt;
          &lt;/div&gt;
          &lt;div id="navbar" class="collapse navbar-collapse"&gt;
            &lt;ul class="nav navbar-nav"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;p id="collapse-init" class="navbar-text"&gt;Open All&lt;/p&gt;&lt;/li&gt;
              
            &lt;/ul&gt;
          &lt;/div&gt;&lt;!--/.nav-collapse --&gt;
        &lt;/div&gt;
      &lt;/nav&gt;
  
      &lt;div class="container"&gt;
  
   
  
  &lt;div class="accordion" id="accordion"&gt;
  &lt;!--Article 1--&gt;
                  &lt;div class="accordion-group"&gt;
                    &lt;div class="accordion-heading"&gt;
                      &lt;a class="accordion-toggle" data-toggle="collapse" href="#collapseOne"&gt;
                        Collapsible Group Item #1
                      &lt;/a&gt;
                    &lt;/div&gt;
                    &lt;div id="collapseOne" class="accordion-body collapse"&gt;
                      &lt;div class="accordion-inner"&gt;
                        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  &lt;!--Article 2--&gt;
                  &lt;div class="accordion-group"&gt;
                    &lt;div class="accordion-heading"&gt;
                      &lt;a class="accordion-toggle" data-toggle="collapse" href="#collapseTwo"&gt;
                        Collapsible Group Item #2
                      &lt;/a&gt;
                    &lt;/div&gt;
                    &lt;div id="collapseTwo" class="accordion-body collapse"&gt;
                      &lt;div class="accordion-inner"&gt;
                        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  &lt;!--Article 3--&gt;
                  &lt;div class="accordion-group"&gt;
                    &lt;div class="accordion-heading"&gt;
                      &lt;a class="accordion-toggle" data-toggle="collapse" href="#collapseThree"&gt;
                        Collapsible Group Item #3
                      &lt;/a&gt;
                    &lt;/div&gt;
                    &lt;div id="collapseThree" class="accordion-body collapse"&gt;
                      &lt;div class="accordion-inner"&gt;
                        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
  &lt;!--Article 4--&gt;
                  &lt;div class="accordion-group"&gt;
                    &lt;div class="accordion-heading"&gt;
                      &lt;a class="accordion-toggle" data-toggle="collapse" href="#collapseFour"&gt;
                        Collapsible Group Item #4
                      &lt;/a&gt;
                    &lt;/div&gt;
                    &lt;div id="collapseFour" class="accordion-body collapse"&gt;
                      &lt;div class="accordion-inner"&gt;
                        Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
  
  
  
      
      
  
      &lt;/div&gt;&lt;!-- /.container --&gt;
  
  
     &lt;!-- jQuery (necessary for Bootstrap's JavaScript plugins) --&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;!-- Include all compiled plugins (below), or include individual files as needed --&gt;
      &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
     &lt;!-- Script for the hide all / show all --&gt;
      &lt;script type="text/javascript"&gt;
       $(function () {
  
      var active = true;
  
      $('#collapse-init').click(function () {
          if (active) {
              active = false;
              $('.accordion-body').collapse('show');
              $('.accordion-heading').attr('data-toggle', '');
              $(this).text('Close All');
          } else {
              active = true;
              $('.accordion-body').collapse('hide');
              $('.accordion-heading').attr('data-toggle', 'collapse');
              $(this).text('Open All');
          }
      });
      
      $('#accordion').on('show.bs.collapse', function () {
          if (active) $('#accordion .in').collapse('hide');
      });
  
  });
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>