1 var select= document.getElementById("selectid"); 2 var objOption = document.createElement("OPTION"); 3 objOption.value = value; 4 objOption.text =text; 5 select.add(objOption);
获取select选中值
var index=document.getElementById("selectid").selectedIndex; var text=document.getElementById("selectid").options[index].text; var val=document.getElementById("selectid").options[index].value;