title: Selectpicker add option in optgroup
body: <p>I want to add an option in an <code>optgroup</code> using jQuery. I am using bootstrap selectpicker. The following is my code:</p>
  
  <pre class="lang-js prettyprint-override"><code>var groupOption = "&lt;option value='123'&gt;123&lt;/option&gt;";
  $("#selectpickerdemo").append(groupOption).selectpicker('refresh');
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;select class="selectpicker" multiple name="selectpickerdemo" id="selectpickerdemo"&gt;
    &lt;optgroup label="Label 1"&gt;
      &lt;option value='abc'&gt;ABC&lt;/option&gt;
      &lt;option value='abcd'&gt;ABCD&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="Label 2"&gt;
      &lt;option value='abc'&gt;ABC&lt;/option&gt;
      &lt;option value='abcd'&gt;ABCD&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>