Did you try my code?  It should do what you describe.

-- Josh


----- Original Message ----- From: "GARIL" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Wednesday, October 01, 2008 1:12 PM
Subject: [jQuery] Re: form select...




Thank your for your answers but I don't want to set the value.
What I want to happen is to programmatically change the select into:

BEFORE                                     AFTER
<form>                                       <form>
Select your favorite fruit:              Select your favorite fruit:
<select id="fruits">                     <select id="fruits">
 <option>Apple</option>            <option>Apple</option>
 <option>Orange</option>          <option>Orange</option>
 <option>Pineapple</option>      <option SELECTED>Pineapple</option>
<----------------------
 <option>Banana</option>         <option>Banana</option>
</select>                                  </select>
</form>                                    </form>


On Oct 1, 2:50 pm, greenteam003 <[EMAIL PROTECTED]> wrote:
You could achieve this by using $('#fruits').val('Banana').

Reply via email to