option in select is not selected without alert() in jQuery
<p>I have the following code snippet in my jquery. <code>update_obj['events']</code> holds the values of the options that I want to get selected. I have a set of <code>select</code> elements and their id begins with <code>event_drop_down_</code>. This code works fine. But if I comment the <code>alert(v)</code> the options are not get selected in the <code>select</code> elements. The only other event related to the <code>select</code> elements is <code>.change()</code>. I commented it and tried, still the issue persists. Any help/suggestion to overcome this is highly appreciated.</p>

<pre><code>    var i =0;
$(update_obj['events']).each(function(v){
        alert(v);
    $('#event_drop_down_' + i + ' option[value=' + update_obj['events'][v] + ']').attr('selected', 'selected');
    i = i+1;
});     
</code></pre>
