如何利用vbscript在客户端页面生成下拉列表
如题,如何在客户端页面,使用vbscript向<select></select>中添加<option>数据</option>
[解决办法]
<script language="vbscript">
Sub AddOption()
Dim o
Set o = document.createElement("option")
o.innerText = "new"
o.value = "4"
document.getElementById("s").appendChild(o)
End Sub
</script>
<button onclick="AddOption()">Add Option </button> <br />
<select id="s">
<option value="1">a </option>
<option value="2">b </option>
<option value="3">c </option>
</select>