title: auto select using jquery not works if data is collected using ajax
body: <p>I loaded the selection data from database automatically using ajax</p>
  
  <pre><code> &lt;div class="row-form"&gt;
            &lt;div class="span2"&gt;Condition:&lt;/div&gt;
            &lt;div class="span4 input-prepend"&gt;
            &lt;span class="add-on blue"&gt;&lt;i class="icon-arrow-down icon-white"&gt;&lt;/i&gt;&lt;/span&gt;
            &lt;select name="condition" id="condition" class="validate[required]" &gt;
             &lt;/select&gt;
            &lt;/div&gt;
        &lt;/div&gt;
  
  
      //ajax function to load condition to select box
  $.ajax({
      url:'search/condition.php',
      type:'POST',
      async:true,
      success: function(data){
          $("#condition").html(data);
      }
  });
  </code></pre>
  
  <p>PHP Code for ajax :-</p>
  
  <pre><code>&lt;?php
  require("../dbconnect.php");
  
      $qry="SELECT * FROM  condition_master";
          $rs=mysqli_query($con,$qry);
         $data .= "&lt;option value=''&gt;Select condition&lt;/option&gt;";
        while($row=mysqli_fetch_array($rs)){
            $des=$row['condition_des'];
            $data .= "&lt;option value='$des'&gt;$des&lt;/option&gt;";
        }
  
        echo $data;
  ?&gt;
  </code></pre>
  
  <p>its loading properly.. but while trying to auto select the condition using jquery its not selecting properly</p>
  
  <pre><code> &lt;script&gt;
      $(function(){
          $("#condition").val('used');
      });
   &lt;/script&gt;
  </code></pre>