title: How do I select an option of select after triggering an event
body: <p>I have a jquery postback and after getting reply as JSON I'm changing value of an input type select like this</p>
  
  <pre><code>$('#new-address select[name=\'country_id\']').val(data['country_id']).trigger('change');
  $('#new-address select[name=\'zone_id\']').val(data['zone_id']);
  </code></pre>
  
  <p>and after changing the selected value I am firing an event 'change' to fill state select input and after that I want to change the selected value of state select input but from above code it's not changing the value of state select but it's filling states. </p>
  
  <p>So I thought may be control is not coming back after trigger to this function so to test that I put one alert to see whether it's coming here or not like this</p>
  
  <pre><code>$('#new-address select[name=\'country_id\']').val(data['country_id']).trigger('change');
  alert('came here');
  $('#new-address select[name=\'zone_id\']').val(data['zone_id']);
  </code></pre>
  
  <p>after testing this I got alert saying came here and after clicking OK, the value of state is changing as I wanted.</p>
  
  <p>So what is wrong in my approach before and why it's working fine after adding alert? What changes should I do to get what I want?</p>
  
  <p>Thanks in advance.</p>