title: Get the current value in bootstrap-select
body: <p>I used <code>e.target.value</code> to retrieve the current selected value from bootstrap-select but it returned the first selected value i.e. the alert kept displaying item 1, when item 1 and item 2 where selected even when item 2 was the most recently selected.</p>
  
  <p>How can I get the value for the recent selection and how can I get how many options are selected?</p>
  
  <pre><code>   &lt;select multiple class="selectpicker" multiple data-selected-text-format="count &gt; 1"&gt;
      &lt;option value="item 1"&gt;Item 1&lt;/option&gt;
      &lt;option value="item 2"&gt;Item 2&lt;/option&gt;
      &lt;option value="item 3"&gt;Item 3&lt;/option&gt;
      &lt;option value="item 4"&gt;Item 4&lt;/option&gt;
      &lt;option value="item 5"&gt;Item 5&lt;/option&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>$('.selectpicker').change(function (e) {
      alert(e.target.value);
  });
  </code></pre>