I am trying to use jQuery to set one of the options of a dropdown menu as the selected one. This is what I've tried: (The code is within a document ready block)
$('#regio option[value="'+ $.cookie("regio") +'"]').prop('selected', true);
This is the HTML code:
<select class="form-control" id="regio">
<!-- Here are some options -->
Nothing happens after this. I have debugged all the values using firebug and the cookie does correspond to one of the select values. What could be the problem?