Reputation: 19297
There are two select
elements. Their default value is "" showing the text "Select a value". I want to know with jQuery
which of them the user selected last in the case their values are both not "" ?
Upvotes: 0
Views: 59
Reputation: 27287
You can track this manually:
<select id="s1" class="watched">
...
</select>
<select id="s2" class="watched">
...
</select>
...
var lastChanged = $();
$('select.watched').on('change'){
lastChanged = $(this);
}
Note that it's not neccessary to set the class as long as you can identify the select
s through other means (e.g. $('form#my-form select')
or even $('select')
if there are no other select
s on the page).
Upvotes: 1