1 <select onchange='function1();'> <option>...</option> <option>...</option> </select> function1函数里完成对第二个下拉框的初始化. 2 var objSelect = document.getElementById("select2"); var option = document.createElement("option"); var text = 'text'; var value = 'value'; objSelect.option.add(option);
var objSelect = document.getElementById("select2"); var option = document.createElement("option"); var text = 'text'; var value = 'value'; option.text = text; option.value = value; objSelect.option.add(option);
<option>...</option>
<option>...</option>
</select>
function1函数里完成对第二个下拉框的初始化.
2
var objSelect = document.getElementById("select2");
var option = document.createElement("option");
var text = 'text';
var value = 'value';
objSelect.option.add(option);
var option = document.createElement("option");
var text = 'text';
var value = 'value';
option.text = text;
option.value = value;
objSelect.option.add(option);