so apparently you have the following
<select>
<option value="0">One</option>
<option value="1">Two</option>
</select>
$('select').val('1'); // selects "Two"
$('select').val('Two'); // also selects "Two"
but what if you have
<select>
<option value="0">1</option>
<option value="1">0</option>
</select>
And I want to set the value…of the form…how can I tell jquery to specifically use the value field or specifically the text in between the option tag…
Just select the
optionbased on the value (with the attribute selector) and set the selected attribute like this:http://jsfiddle.net/VU9BC/