title: Expand all/Collapse all button js
body: <p>i'm using this W3Schools tutorial to create some collapsibles. I'd like to create two buttons which could collapse or expand all the collapsibles. 
  I've included the codesnippet i am using. I can't seem to create two working buttons so i've just posted the code i am currently working with. </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 coll = document.getElementsByClassName("collapsible");
  var i;
  
  for (i = 0; i &lt; coll.length; i++) 
  {
    coll[i].addEventListener("click", function() 
    {
      this.classList.toggle("active");
      var content = this.nextElementSibling;
      if (content.style.maxHeight)
      {
        content.style.maxHeight = null;
      } 
      else 
      {
        content.style.maxHeight = content.scrollHeight + "px";
      } 
    });
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>&lt;style&gt;
  .collapsible {
      background-color: #777;
      color: white;
      cursor: pointer;
      padding: 18px;
      width: 100%;
      border: none;
      text-align: left;
      outline: none;
      font-size: 15px;
  }
  
  .active, .collapsible:hover {
      background-color: #555;
  }
  
  .collapsible:after {
      content: '\002B';
      color: white;
      font-weight: bold;
      float: right;
      margin-left: 5px;
  }
  
  .active:after {
      content: "\2212";
  }
  
  .content {
      padding: 0 18px;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.2s ease-out;
      background-color: #f1f1f1;
  }
  &lt;/style&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;button class="collapsible"&gt;Open Section 2&lt;/button&gt;
  &lt;div class="content"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
  &lt;/div&gt;
  &lt;button class="collapsible"&gt;Open Section 3&lt;/button&gt;
  &lt;div class="content"&gt;
    &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>