📜  select option select with dont call change - Javascript代码示例

📅  最后修改于: 2022-03-11 15:02:06.956000             🧑  作者: Mango

代码示例1
old_value = $('#select :selected').val();
$('#select').change(function() {
  if($(this).val() == 'option 3') {//your specific condition
     $('#select').val(old_value);
  } else {
    old_value = $('#select :selected').val();
  }
});