Capture Current Selected Option - multipleselect

1

Given a multiple select field, how do I get via javascript the value of the option that was last selected (current)?

I have tried to use the expression below, however the last value (in alphabetical order) of the list of selected items is returned, not necessarily the last one selected.

$("option:selected:last",this)).val()
    
asked by anonymous 17.07.2014 / 03:46

1 answer

1

Dude, just like "charlietfl" I thought this would be a simple workout, but it's pretty chatinho.

Retrieving the select value is not a problem, the problem is just how they are stored in the array.

This fiddle solves your problem: link

Original fiddle post: link

    
17.07.2014 / 06:07