title: get previous and present selected value of the dropdown using chosen in jquery
body: <p>I have a drop down</p>
  
  <pre><code> &lt;select name="manager" class="managerchosen-select-deselect" &gt;
      &lt;option value="" &gt;Select  Manager&lt;/option&gt;
      &lt;option value="xyz"&gt; XYZ &lt;/option&gt;
      &lt;option value="abc"&gt; ABC&lt;/option&gt;
      &lt;option value="pqr"&gt; PQR&lt;/option&gt;
    &lt;/select&gt;
  </code></pre>
  
  <p>I need 2 alerts based on 2 events on this drop down. First is When I click on the drop down the previous value must be shown in alert and the second is on change of drop down the present selected value is to be displayed in alert. </p>
  
  <p>I have tried the following jquery code, but I am getting only one alert i.e on change. I am not getting alert for on click. Why?</p>
  
  <pre><code>    var lastvalue;
     $(".manager").bind("click", function(e){
       lastValue = $(this).val(); 
       alert(lastvalue);
       }).bind("change", function(e){ alert('value changed');
       changeConfirmation = confirm("Are You Sure?");
     if (changeConfirmation) {
        //proceed
     } else {
        $(this).val(lastValue);
     }
     });
  </code></pre>