title: How to get last selected item from chosen multiselect plugin
body: <p>As the question says, I would like to know how to get the last selected item value from chosen multiselect plugin.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>$(document).ready(function() {
      $('#id').chosen().on('change', function(evt, param) {
              var id1 = this.value;
              var id2 = $("#id").chosen().val();
              var id3 = $('#id', this).filter(':selected:last').val();
              var id4 = $(evt.target).text();
  
              alert('IDs:' +id1+'-'+id2+'-'+id3+'-'+id4);
      });
  });
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>2 - undefined - undefined - [all the values]
  </code></pre>
  
  <p>The first answer is correct (I chose the second value).</p>
  
  <p>But if I later choose the 3rd value or one after the one I chose before, it keeps showing me the first value I chose. However, if I choose a value situated before the first one it works perfectly and I don't know why.</p>
  
  <p>Any help would be great. </p>