临时记录

  1. (function () {
  2.  
    var previous;
  3.  
     
  4.  
    $("select").on('focus', function () {
  5.  
    // Store the current value on focus and on change
  6.  
    previous = this.value;
  7.  
    }).change(function() {
  8.  
    // Do something with the previous value after the change
  9.  
    alert(previous);
  10.  
     
  11.  
    // Make sure the previous value is updated
  12.  
    previous = this.value;
  13.  
    });
  14.  
    })();
原文地址:https://www.cnblogs.com/beimingbingpo/p/9406858.html