title: disable bootstrap select option using javascript
body: <p>I attempt to disable my specific bootstrap select option using javascript.</p>
  
  <p>I know how to disable "normal select option", but when using bootstrap select it just didnt works (its disabled/greyed but i can still choose it)
  here <a href="https://jsfiddle.net/ybf5hpam/1/" rel="nofollow noreferrer">jsfidle</a></p>
  
  <pre><code>&lt;select name="dropdownBranch" id="dropdownBranch" class="selectpicker" data-live-search="true"&gt;
    &lt;option value="0"&gt;Choose Number&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;
    &lt;option value="4"&gt;4&lt;/option&gt;
  &lt;/select&gt;
  &lt;select id="pureDropDown"&gt;
    &lt;option value="0"&gt;Choose Number&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
    &lt;option value="2"&gt;2&lt;/option&gt;
    &lt;option value="3"&gt;3&lt;/option&gt;
    &lt;option value="4"&gt;4&lt;/option&gt;
  &lt;/select&gt;
  &lt;button onclick="disableDropdown()"&gt;disable&lt;/button&gt;
  
  
  
  function disableDropdown(){
  var selectobject;
  selectobject=document.getElementById("dropdownBranch").getElementsByTagName("option");
      selectobject[3].disabled=true;
  
  selectobject=document.getElementById("pureDropDown").getElementsByTagName("option");
      for(z=0;z&lt;selectobject.length;z++){
          selectobject[z].disabled=true;
          }
  
  }
  </code></pre>
  
  <p>i try to remove specific option too and the same case happen (work on normal dropdown but not work on bootstrap select)</p>