title: Bootstrap select redirect to option value link
body: <p>I want to redirect to a page based on the selected option value from the bootstrap select.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select class="selectpicker"&gt;
      &lt;option value="https://stackoverflow.com/"&gt;Home&lt;/option&gt;
      &lt;option value="https://stackoverflow.com/questions/ask"&gt;Ask Question&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>$('.selectpicker').selectpicker();
  </code></pre>
  
  <p>This is my code but it's not working:</p>
  
  <pre><code>$(document).on('change', '.selectpicker', function(e){
      e.preventDefault();
  
      window.location = $(this).val();
  });
  </code></pre>