jquery 取得select onchange之前的值

其實是個彙總

(function () {
    var previous;

    $("select").on('focus', function () {
        // Store the current value on focus and on change
        previous = this.value;
    }).change(function() {
        // Do something with the previous value after the change
        alert(previous);

        // Make sure the previous value is updated
        previous = this.value;
    });
})();



https://stackoverflow.com/questions/4076770/getting-value-of-select-dropdown-before-change


https://stackoverflow.com/questions/18868867/jquery-chosen-before-change-event
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章