首页 > 代码库 > javascript 向下拉列表框select添加选项option

javascript 向下拉列表框select添加选项option

1 var select= document.getElementById("selectid");
2 var objOption = document.createElement("OPTION");
3 objOption.value =http://www.mamicode.com/ value;
4 objOption.text =text;
5 select.add(objOption);

 

javascript 向下拉列表框select添加选项option