How to set the value of dropdown while adding options in Javascript?
<p>I use below code to add options for dropdown </p>

<pre><code>             //HTML CODE
            select(name='folist',  id='folist').
            //JS Code
             for(var i=0;i&lt;data.foNameArray.length;i++){
            var combo = document.getElementById("folist");

            option = document.createElement("option");
            option.text = data.foNameArray[i];
            option.value =data.foIdArray[i];
             try {
                combo.add(option, null); //Standard 
            }catch(error) {
                combo.add(option); // IE only
            }
            }
</code></pre>

<p>It perfectly works.Now My doubt is how to select the value while adding like selected="selected".</p>
