Wednesday, October 1, 2008

[jQuery] Re: form select...

You could achieve this by using $('#fruits').val('Banana').

All of this is available in the jquery api docs if you take a look. Take a
look at http://docs.jquery.com/Attributes
http://docs.jquery.com/Attributes for examples of what you're trying to
accomplish with the select elements.

GARIL wrote:
>
>
> How do I use jQuery to determine which item was selected from the
> forms below?
> Thank you for the help.
>
> <form>
> Select your favorite fruit:
> <select id="fruits">
> <option>Apple</option>
> <option>Orange</option>
> <option>Pineapple</option>
> <option>Banana</option>
> </select>
> </form>
>
> <form>
> Select your favorite fruit:
> <select id="analysis">
> <option>All fruits</option>
> <option>Some only...</option>
> </select>
> </form>
>
>

--
View this message in context: http://www.nabble.com/form-select...-tp19708959s27240p19767784.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

No comments: