Problem when setting a value to a dropdown in jQuery
<p>I have this strange problem in JQuery. I try to set a value to a dropdown dinamically, so I have this code:</p>

<pre><code>$('#activity').val(idValue);
//or this way:
$('#activity').val("'"+idValue+"'");
</code></pre>

<p>but it does not work. However, if I'm setting the value "statically" then it works:</p>

<pre><code>$('#activity').val('23');
</code></pre>

<p>So, why does not accept the value from the variable? Or what am I doing wrong? Thanks!</p>

<p><strong>UPDATE</strong></p>

<p>I have tried the code in jsfiddle and it does work. It seems that the problem was related to the JSON data i was parsing. Thanks for the help!</p>
