JSFiddle - React, Tailwind, and code Playground
HTML
<select name="test">
<option value="stack">Stack</option>
<option value="overflow">Overflow</option>
<option value="my">My</option>
<option value="question">Question</option>
</select>
JavaScript
(function () {
var previous;
$("select[name=test]").focus(function () {
// Store the current value on focus, before it changes
previous = this.value;
}).change(function() {
// Do soomething with the previous value after the change
$("select[name=test]").val(previous);
});
})();