title: Bootstrap collapse panel closed by default
body: <p>I use a bootstrap panel and i added a span clickable icon : plus when panel body is open and minus when panel body is close, my problem now is how can i do to set it close by default(plus icon showed by default and when i click on it panel body will be opening)</p>
  
  <p>above my code to do this, thanks in advance for your help.</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;!-- Latest compiled and minified CSS --&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
  
  &lt;!-- Optional theme --&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!-- Latest compiled and minified JavaScript --&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).on('click', '.panel-heading span.clickable', function (e) {
      var $this = $(this);
      if (!$this.hasClass('panel-collapsed')) {
  
          $this.parents('.panel').find('.panel-body').slideUp();
          $this.addClass('panel-collapsed');
          $this.find('i').removeClass('glyphicon-minus').addClass('glyphicon-plus');
      } else {
      console.log($this);
  
          $this.parents('.panel').find('.panel-body').slideDown();
          $this.removeClass('panel-collapsed');
          $this.find('i').removeClass('glyphicon-plus').addClass('glyphicon-minus');
      }
  });
  &lt;/script&gt;
  &lt;style&gt;
  
  .clickable
  {
      cursor: pointer;
  }
  
  .clickable .glyphicon
  {
      background: rgba(0, 0, 0, 0.15);
      display: inline-block;
      padding: 6px 12px;
      border-radius: 4px
  }
  
  .panel-heading span
  {
      margin-top: -23px;
      font-size: 15px;
      margin-right: -9px;
  }
  &lt;/style&gt;
  &lt;/head&gt;
   &lt;body&gt;
   &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-md-6"&gt;
              &lt;div class="panel panel-primary"&gt;
                  &lt;div class="panel-heading"&gt;
                      &lt;h3 class="panel-title"&gt;
                          Panel 1&lt;/h3&gt;
                      &lt;span class="pull-right clickable panel-collapsed in"&gt;&lt;i class="glyphicon glyphicon-plus"&gt;&lt;/i&gt;&lt;/span&gt;
                  &lt;/div&gt;
                  &lt;div class="panel-body"&gt;
                      Panel content&lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
   &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>