<HTML>
<HEAD>
<TITLE>Dynamically populating drop down, combobox, list box using JavaScript</TITLE>
<SCRIPT language="javascript">
function addCombo() {
var textb = document.getElementById("txtCombo");
var combo = document.getElementById("combo");

var option = document.createElement("option");
option.text = textb.value;
option.value = textb.value;
try {
combo.add(option, null); //Standard
}catch(error) {
combo.add(option); // IE only
}
textb.value = "";
}
</SCRIPT>
</HEAD>
<BODY style="font-family: sans-serif">

<fieldset>

<legend>Combo box</legend>
Add to Combo: <input type="text" name="txtCombo" id="txtCombo"/>
<input type="button" value="Add" onclick="addCombo()">
<br/>
Combobox: <select name="combo" id="combo"></select>

</fieldset>
</BODY>
</HTML>