Set a select option using variable in jQuery
<p>Im using jquery cookie plugin to set a cookie for my dropdown. This means when someone selects either Yes or No from the dropdown then the value writes to the cookie.</p>

<p>This works, I can successfully console.log the cookie value too. But When I try to use the cookie to AUTO-SELECT the dropdown value it matches, it just sticks to 'no' all the time.</p>

<p>am I missing something?</p>

<p><strong>html</strong></p>

<pre><code>&lt;select id="delete"&gt;
    &lt;option value="no"&gt;No&lt;/option&gt;
    &lt;option value="yes"&gt;Yes&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p><strong>jquery</strong></p>

<pre><code>$(document).ready(function(e) {
var thiscookie = $.cookie('1C');
    $('#delete').val(thiscookie);
    $('#delete').change(function(){
        var choice =  $(this).find("option:selected").val();
        $.cookie('1C',choice);
    });
});
</code></pre>

<p>Note: If I set the val of the selectbox in jquery to 'yes' it doesn't work either</p>
