I've run into this problem too and found that I get better results by
accessing the "value" attribute instead of using .val():
$('#aUsers option:selected').each(function() {
    console.log('user: ' + $(this).attr('value'));
});

--
Hector


On Mon, Jul 20, 2009 at 2:40 AM, debussy007 <debussy...@gmail.com> wrote:

>
>
>
> Uhm ... for some obscure reason I got it working now ...
>
>
>
> debussy007 wrote:
> >
> > Hello,
> >
> > The following code below doesn't seem to give the expected result:
> >
> > $('#aUsers option:selected').each(function() {
> >      console.log('user: ' + $(this).val());
> > });
> >
> > It will display the empty string.
> >
>
> --
> View this message in context:
> http://www.nabble.com/Get-the-value-of-the-option-elements-tp24566521s27240p24566693.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>

Reply via email to