I need select's option to be actually selected on document ready depending on an input's value.
Example:
<select id=mySelect>
<option value=1>myVal1</option>
<option value=2>myVal2</option>
</select>
<input type=text id=myId value=2>
For example, we've got a predefined value '2' of the input on page load. I need select-box to be auto-selected with it's option having the same value as input 'myId'. I mean 'mayVal1' must be selected.
When input has no value select must behave as default.
Thanks!