What's wrong with this code?
jQuery
$(document).ready(function() { $("#routetype").val('quietest'); )}; HTML
<select id="routetype" name="routetype"> <option value="fastest">Fastest</option> <option selected="true" value="balanced">Balanced</option> <option value="quietest">Quietest</option> </select> It gives me 'Balanced' as the selected option, not 'Quietest'.
$(document).readyshould end with});not)};See: jsfiddle.net/x3UyB/2