title: Get the index of recently selected option in multiselect dropdown jquery
body: <p>I have a select dropdown in my html page. How can I get the index of the most recently selected option, not the last. I saw that we can use <code>'last'</code>, but it will give the last option which was selected not the most recent. </p>
  
  <p>HTML</p>
  
  <pre><code>&lt;select class="carMenu" name="cars" multiple&gt;
    &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
    &lt;option value="saab"&gt;Saab&lt;/option&gt;
    &lt;option value="opel"&gt;Opel&lt;/option&gt;
    &lt;option value="audi"&gt;Audi&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>jQuery</p>
  
  <pre><code>$(document).ready(function () {
      $('.carMenu').change(function(){
           console.log($('option:selected',$(this)).index());
      });
  });
  </code></pre>
  
  <p>If we select 'Opel' and then 'Volvo', we should get zero as the index. But now it gives index of 'Opel'. </p>