title: jquery bind value to html select tag
body: <p>can anyone help with the following:</p>
  
  <p>I have an ajax method that calls server side code and retrieves list of books and loads into html table. </p>
  
  <pre><code>   function LoadData(data) {
  
    var tbody = $("#accountTable &gt; tbody").html("");
    var thead = $("#accountTable &gt; thead").html("");
  
     var rowHead = "&lt;tr&gt;"
                  + "&lt;th style='border-bottom-style:dotted;border-bottom-width:1px;font-size:10px'&gt;Name&lt;/th&gt;"
                  + "&lt;th style='border-bottom-style:dotted;border-bottom-width:1px;font-size:10px'&gt;Quantity&lt;/th&gt;"
                  + "&lt;th style='border-bottom-style:dotted;border-bottom-width:1px;font-size:10px'&gt;Price&lt;/th&gt;"
                  + "&lt;th style='border-bottom-style:dotted;border-bottom-width:1px;font-size:10px'&gt;Status&lt;/th&gt;"
                  + "&lt;/tr&gt;";
      $(rowHead).appendTo(thead);
  
      // ASP.NET encapsulates JSON responses in a property "d"
      if (data.hasOwnProperty("d")) 
      { 
          data = data.d;     
      }
  
      //iterate through and append to table
      for (i = 0; i &lt; data.length; i++) {
       var rowText = "&lt;tr&gt;&lt;td style='text-align: left;font-size:10px;'&gt;" + data[i].Name
          + "&lt;/td&gt;&lt;td style='text-align: left;font-size:10px;'&gt;" + data[i].Quantity 
          + "&lt;/td&gt;&lt;td style='text-align: left;font-size:10px;'&gt;" + data[i].Price 
          + "&lt;/td&gt;&lt;td style='text-align: left;font-size:10px;'&gt;"
          + "&lt;select id=" + data[i].Id + "&gt;"
          + "&lt;option value='Unconfirmed'&gt;UnConfirmed&lt;/option&gt;" 
          + "&lt;option value='Confirmed'&gt;Confirmed&lt;/option&gt;"
          + "&lt;option value='Suspend'&gt;Suspend&lt;/option&gt;"
          + "&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;";
          $(rowText).appendTo(tbody);
  
          } 
  }
  </code></pre>
  
  <p>How do I bind the field Status' (data[i].Status) value from the database to the select tag.  The user can toggle this value, but the default value should bind to the value from the database.  Thanks in advance.</p>