Jquery / Javascript - most efficient way to build a select menu?
<p>I'm using jquery and trying to tune my select menu builder to run much quicker. </p>

<p>I was using each and append, however I've since switched to a standard for loop and currently trying to convert my options from using append to concatenated string appended to my select option using .html(). I seem to be at a loss trying to convert my var option object back to an html string. Could someone please tell me what I might be doing wrong. </p>

<pre><code>$.selectMenuBuilder = function(json) {
    var myselect = $("#myselect");    
    var list = "&lt;option value=\"\"&gt;&gt; Select Account Number&lt;/option&gt;";

    var l= json.funding.length;
    for(var i=0;i&lt;l; i++) { 
       var funding = json.funding[i];    
       var option = $("&lt;option value=\"" + funding.id + "\"&gt;" + funding.accountNumber + "&lt;/option&gt;")

       if(someLogic) {
           option.attr("selected", "selected");
       }

       //Having trouble here converting option object back to html. 
       list += option.html();
   }

   list += "&lt;option value=\"addnew\"&gt;+ New Account Number&lt;/option&gt;";

   myselect .html(list);
}
</code></pre>
