given that it's not multiple=multiple, then:

    $('weightclass').getSelected()[0].get('text');

getSelected will return a collection of all selected options.
http://mootools.net/docs/core/Element/Element#Element:getSelected


On 4 June 2013 23:12, Jeff Dunlap <jeff_j_dun...@yahoo.com> wrote:

> Dear users:
>
> I'm having some difficulty getting the selected item's display text (i.e.
> 'Third') for a dropdown:
>
> <select id="weightclass">
>   <option value="1">First</option>
>   <option value="2">Second</option>
>   <option value="3">Third</option>
> </select>
>
> // using the 'value' property
> var mystring = $('weightclass').get('value');    // returns 3
>
> var mystring = $('weightclass').get('text');     // returns text for ALL
> of the items
>
> Thank you
>
>
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "MooTools Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mootools-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Dimitar Christoff

"JavaScript is to JAVA what hamster is to ham"
@D_mitar - https://github.com/DimitarChristoff

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"MooTools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mootools-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to