I have a html select box.

I have a option key in a javascript variable.


I want to update html select box if the key matches to any of the options in the html select box. I need a javascript/jquery solution to do this.


Example:
-------------
I have inputs as ...
Input:

HTML select box
<select name="something" id="selectedCar">
<option value="1">Volvo</option>
<option value="2" selected="selected">Saab</option>
<option value="3">Mercedes</option>
<option value="4">Audi</option>
</select>


Javascript variable

var selectKey="4";


I want output as ..

Output HTML

<select name="something" id="selectedCar">
<option value="1">Volvo</option>
<option value="2">Saab</option>
<option value="3">Mercedes</option>
<option value="4" selected="selected">Audi</option>
</select>


I need a javascript / Jquery solution to achieve this . Do you have a solution to this problem ?