Can someone explain this behavior:
<select id ="test">
<option value="-1">---All---</option>
<option value="1">first</option>
<option value="2">second</option>
</select>
$('#test').val(200);
Using the jQuery 1.10.1 the value of the select is null, but using jQuery 1.9.1 the value is the first option.
jsFiddle
Using the jQuery 1.10.1 the value of the select is null, but using jQuery 1.9.1 the value is the first option.
It's the fix to bug #13514, fixed in v1.10. Setting an invalid value should clear the select (which it does in v1.10+), not leave it at the default (first) option (v1.9).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With