title: jQuery append select options - selected not working
body: <p>I am building a select box by grabbing the options using ajax. I am then checking if the value of each options is the same as the current selected, and if so add the 'selected' attribute. The 'selected' attribute is being added fine but that option does not show as selected.</p>
  
  <p>This is how I'm appending the options to the select..</p>
  
  <pre><code>for (var i=0; i&lt;client_jobs.length; i++) {
      if(current_job == client_jobs[i].id){
          sel.append('&lt;option value="' + client_jobs[i].id + '" selected="selected"&gt;' + client_jobs[i].label + '&lt;/option&gt;');
      }else{
          sel.append('&lt;option value="' + client_jobs[i].id + '"&gt;' + client_jobs[i].label + '&lt;/option&gt;');  
      }   
  }
  </code></pre>
  
  <p>The correct option is seen like this:</p>
  
  <pre><code>&lt;option value="5" selected="selected"&gt;fifth test job&lt;/option&gt;
  </code></pre>
  
  <p>But it is not actually selected, it's always the first options which is seen.</p>
  
  <p>Any ideas what I'm doing wrong?</p>
  
  <p>Thanks.</p>