标签:
var v_select = document.getElementById("selectA");
var v_option = document.createElement("OPTION");
v_select.options.add(v_option);
v_option.innerHTML="name";
v_option.value = "1";
var v_option2 = document.createElement("OPTION");
v_select.options.add(v_option2);
v_option2.innerHTML="name2";
v_option2.value = "2";
要点是:
先v_select.options.add()
然后再设置v_option.value值
标签:
原文地址:http://www.cnblogs.com/javaeye235/p/5133913.html