Ve como andas con esto:
Código HTML:
Ver original <script type="text/javascript"> function add(){
var text = document.getElementById("text");
var sel = document.getElementById("sel");
var opt = document.createElement("option");
opt.appendChild(document.createTextNode(text.value));
opt.setAttribute("value", text.value);
sel.appendChild(opt);
}
function see(){
alert(document.getElementById("sel").value);
}
</select> Valor seleccionado:
<input type="button" onclick="see();" value="Ver" /><br/> Agregar opción:
<input type="text" id="text"><input type="button" onclick="add();" value="Agregar" /><br/>