title: Create bootstrap select picker dynamically
body: <p>I'm using the <a href="http://silviomoreto.github.io/bootstrap-select/examples/" rel="noreferrer">bootstrap select plugin</a>. I am populating a dynamically created select like so:</p>
  
  <pre><code>var select = $('&lt;select/&gt;', {
       'class':"selectpicker"
  }).selectpicker();
  
  for (var idx in data) {
      if (data.hasOwnProperty(idx)) {
          select.append('&lt;option value=' + data[idx].id+ '&gt;' + data[idx].Text+ '&lt;/option&gt;');
      }
  }
  
  select.selectpicker('refresh');
  </code></pre>
  
  <p>The data is fine and a select is created, it is not recognizing the bootstrap selectpicker i am trying to create. I have a select on the same page that I do not create dynamically and it works fine.</p>
  
  <pre><code>&lt;select class="selectpicker"&gt;
      &lt;option&gt;Mustard&lt;/option&gt;
      &lt;option&gt;Ketchup&lt;/option&gt;
      &lt;option&gt;Relish&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$('.selectpicker').selectpicker();
  </code></pre>
  
  <p>How do I dynamically create a bootstrap select? Thanks.</p>