title: Show/hide options on bootstrap-select?
body: <p>Short time ago i trying to write a little snippet on bootstrap-select lib, which should open and hide some extra options on click/change event on parent option (half of this in bottom example). </p>
  
  <p><strong>How it should to work...</strong></p>
  
  <p>When the user clicks on a specific option item, some extra items with more additional information are showing up below the parent. When the user clicks one more time, extra items should be hidden and child items are cleared from already selected options. </p>
  
  <p><strong>What is the problem?</strong></p>
  
  <p>Unfortunately my level of jquery isn't high, so for this moment i have only /showing/ functionality without /hiding/ child items and clearing selected (if some child of hided parent was selected). And will be great if checked arrow on parent item will not showing, only on child. </p>
  
  <p><strong>My example</strong></p>
  
  <p>This is my short code - </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    $('.remove-example').find('.hider').hide();
  
    $('.selectpicker').change(function() {
  
        var feta = $(this).find("option:selected:first").attr('id');
        var feta1 = $(this).find("option:selected:last").attr('id');
        
        $('.remove-example').find('.' + feta).show();
        $('.remove-example').find('.' + feta1).show();
        
      $('.remove-example').selectpicker('refresh');
  
    });
  
  
  
  
  $('.rm-mustard').click(function() {
      $('.remove-example').find('.Mustard').hide();
      $('.remove-example').selectpicker('refresh');
    });
    $('.rm-mustard1').click(function() {
      $('.remove-example').find('.Mustard').show();
      $('.remove-example').selectpicker('refresh');
    });
  
  
   $('.selectpicker').selectpicker();</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.btn-primary {
    padding: 0px 74px;
    margin-top: 5px;
  }                
  #tastes {
    margin: 15px 0px 0px 15px;
  }
  
  .padd {
   margin-left:20px;   
  }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"&gt;&lt;/script&gt;
  &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/js/bootstrap-select.js"&gt;&lt;/script&gt;
  &lt;script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.js"&gt;&lt;/script&gt;
  
  &lt;link href="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/css/bootstrap-select.css" rel="stylesheet"/&gt;
  &lt;link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet"/&gt;
  
   &lt;select class="selectpicker remove-example" multiple&gt;
      &lt;option  id="Mustard" value=""&gt;Mustard&lt;/option&gt;
       &lt;option data-subtext="50g" class="Mustard hider padd"&gt;Mustard2&lt;/option&gt;
       &lt;option data-subtext="1kg" class="Mustard hider padd"&gt;Mustard3&lt;/option&gt;
      &lt;option id="Ketchup"&gt;Ketchup&lt;/option&gt;
       &lt;option data-subtext="50g" class="Ketchup hider padd"&gt;Ketchup2&lt;/option&gt;
       &lt;option data-subtext="1kg" class="Ketchup hider padd"&gt;Ketchup3&lt;/option&gt;
      &lt;option value="Relish"&gt;Relish&lt;/option&gt;
    &lt;/select&gt;
  
  
  &lt;button class="btn btn-success rm-mustard1"&gt;Show Mustard&lt;/button&gt;
  &lt;button class="btn btn-warning rm-mustard"&gt;Remove again&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="http://jsfiddle.net/k0r974b7/" rel="noreferrer">http://jsfiddle.net/k0r974b7/</a></p>
  
  <p>Parent is: Mustard/Ketchup</p>
  
  <p>Child is: Mustard1,Mustard2/Ketchup1,Ketchup2</p>