$(this).find('select option:selected').each(function (i, val) {
var selectedValue = $(val).val(); //this returns the text from the option instead of the value
});
Is this a known issue in ie7? I didnt find any info about it? Possible workarounds? Thanks
According to the docs at http://api.jquery.com/val/
.val()is only applicable toTo achieve what you want, you could just iterate over the
selectand call.val()on it, your original code effectively is callingval()onoption, not the actualselectelement, which is why it doesn’t really work.val()has an added bonus of having the capability to return an array of values in case ofmultipleselect: (emphasize mine)