title: Open all for Accordion / print all
body: <p>I have put together a page with accordion function so the page is not too long, now when I want to print the page it will only print the section which is opened, I would love to have a open all button or print all button implemented, any help is greatly appreciated!</p>
  
  <p>Could someone please help?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var acc = document.getElementsByClassName("accordion");
  var i;
  
  for (i = 0; i &lt; acc.length; i++) {
    acc[i].onclick = function() {
      this.classList.toggle("active");
      var panel = this.nextElementSibling;
      if (panel.style.maxHeight) {
        panel.style.maxHeight = null;
      } else {
        panel.style.maxHeight = panel.scrollHeight + "px";
      }
    }
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>button.accordion {
    background-color: #13294b;
    border: 2px solid #59cbe8;
    border-radius: 0px 10px 0px 10px;
    box-shadow: 7px 7px 5px #cccccc;
    color: #fff;
    cursor: pointer;
    padding: 10px 15px 10px 15px;
    margin: 4px 0px 7px 0px;
    width: 100%;
    font-size: 18px;
    transition: 0.4s;
    outline: none;
    text-align: left;
  }
  
  button.accordion.active,
  button.accordion:hover {
    background-color: #1f447b;
  }
  
  button.accordion:after {
    content: '\002B';
    color: #59cbe8;
    font-weight: bold;
    float: right;
  }
  
  button.accordion.active:after {
    content: "\2212";
  }
  
  div.panel {
    padding: 0 18px;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button class="accordion"&gt;Title 1&lt;/button&gt;
  &lt;div class="panel"&gt;content&lt;/div&gt;
  
  &lt;button class="accordion"&gt;Title 2&lt;/button&gt;
  &lt;div class="panel"&gt;content&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>