Question: I want to set alert when the value is same. And the value selected is back to previous value
Here is my HTML:

```js
$("#to").val("BGK");
 var fromCity = "";
 var toCity = "";
   $('#from,#to').change(function(){
     var fromCityVal = $("#from").val();
     var toCityVal = $("#to").val();
       if (fromCityVal == toCityVal){
         alert("city of origin may not be the same as the destination city!");
         } 
         else {
           //here's problem, what should I do?
          $("#from").val();
         }
});
```

```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select name="" id="from">
  <option value="DPS">Denpasar</option>
  <option value="BGK">Bangkok</option>
  <option value="MOS">Moscow</option>
</select>

<select name="" id="to">
  <option value="DPS">Denpasar</option>
  <option value="BGK">Bangkok</option>
  <option value="MOS">Moscow</option>
</select>
```

I try this, but not success, What should I do? or any suggestion? Thank you
Here's my code in jsfiddle: <https://jsfiddle.net/dedi_wibisono17/hx1voew9/>

Answer: 
Another option:

```
$("#to").val("BGK");
            var $fromCityValOld = $("#from").val();
            var $toCityValOld = $("#to").val();
        $('#from,#to').change(function(){
    $fromCityVal = $("#from").val();
    $toCityVal = $("#to").val();
            if ($fromCityVal == $toCityVal){
        alert("city of origin may not be the same as the destination city!");
        $("#from").val($fromCityValOld);
                $("#to").val($toCityValOld);
            }  else {
       $fromCityValOld = $fromCityVal;
       $toCityValOld = $toCityVal;
      }

         });

```

working on [fiddle](https://jsfiddle.net/josegallom/hx1voew9/9/)
At page load , fetch your current selection values in a variable, and map the selection box with this value after alert.