I have the following HTML
<SELECT id='cars'>
<OPTION value='1'>Car One</option>
<OPTION value='2'>Second Car</option>
<OPTION value='3'>Another Car</option>
</SELECT>
And I know that I can change the selected value of the drop-down control to any value using:
$('#cars').val(2); // This will make the combo text: Second Car
But how can I select a value using the text rather than the value?
What I need to do is something like:
$('#cars').val('Another Car');
or
$('#cars').text('Another Car');
but that has no effect...
Any help?