When choosing options, jQuery first looks at the value, and then at the option text. It also goes through options in order. So, $('#selValues').val('3') first selects options 3, but immediately after that it changes the selection to option 4 (since it has the text β3β). Use multiple selections to see that both options are actually selected
<select name="selValues" id="selValues" multiple="multiple"> <option value="1">One</option> <option value="2">Two</option> <option value="3">5</option> <option value="4">3</option> </select>
source share