jquery: why a selector returns me an array, but attribute doesnt?

Posted by Shlomi.A. on Stack Overflow See other posts from Stack Overflow or by Shlomi.A.
Published on 2010-04-15T13:11:11Z Indexed on 2010/04/15 13:13 UTC
Read the original article Hit count: 349

Filed under:
|
|

Hi. I'm trying to understand JQ better. I'm calling an JQ object

$(".FamiliesList li li span[class!='']").prev().find('option:selected')

this returns back to me an array of all the options that their span parent's brother has a classname.

[option, option]

Now- I want to return back an array of the option's values

$(".FamiliesList li li span[class!='']").prev().find('option:selected').attr('value')

this returns back to me only the first child value, and a full array of the values.

Why?

I would appreciate to receive help and understand jq better :)

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about array