title: jQuery not change the selected option after load data with Ajax
body: <p>Why this code:</p>
  
  <pre><code>$('#state option[value=5]').attr('selected', 'selected');
  </code></pre>
  
  <p>Only work in:</p>
  
  <pre><code>load: function (states) {
              $.each(states, function(key, state) {
                  var stateText = state.state + ' (' + state.acronym + ')';
                  $('#state').append($('&lt;option /&gt;').attr('value', state.id).text(stateText));
                  $('#state option[value=5]').attr('selected', 'selected'); // HERE THE CODE WORK
              });
  </code></pre>
  
  <p>and doesn't work in:</p>
  
  <pre><code>$(function() {
      loadData(state);
      $('#state option[value=5]').attr('selected', 'selected'); // HERE THE CODE DOESN'T WORK
  });
  </code></pre>
  
  <p>See the complete JS file:</p>
  
  <pre><code>var loadData = function(object) {
      $.ajax({
          url: object.url(),
          type: "GET",
          dataType: "json",
          async: "false",
          success: function(data) {
              object.load(data);
          }
      });
  };
  
  var state = {
      url: function () {
          return 'resources/js/radio/states/states.json';
      },
      load: function (states) {
          $.each(states, function(key, state) {
              var stateText = state.state + ' (' + state.acronym + ')';
              $('#state').append($('&lt;option /&gt;').attr('value', state.id).text(stateText));
              $('#state option[value=5]').attr('selected', 'selected'); // HERE THE CODE WORK
          });
      }
  };
  
  $(function() {
      loadData(state);
      $('#state option[value=5]').attr('selected', 'selected'); // HERE THE CODE DOESN'T WORK
  });
  </code></pre>