Get click option in multiple drop-down lists
I have a dropdown with several choices, for example:
<select id="myList" multiple="multiple">
<option value="1">Opt #1</option>
<option value="2" selected="selected">Opt #2</option>
<option value="3" selected="selected">Opt #3</option>
<option value="4">Opt #4</option>
</select>
If I then choose Opt #4, then how can I receive Opt #4, and not Opt #2and then Opt #3? I know that I can get all selected options:
var selectedOptions = $("#myList option:selected");
However, I only need the option that I pressed - Opt #4. Is it possible?
Edit: note that when manipulating a list inside an event, changeI cannot do this in the event click. Also added missing few.