How to find out the previously selected option
Hello everybody,
I wonder if anyone can help me with this issue:
How to find out the previously selected option value in a select list?
For example: I have a list with 3 options
- <select id="test">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
When user select, for example, option 3, how can i find which was the previously selected option? etc...
I've found some javascript example that evaluate "previousIndex" property of the select element but it doesn't work at all