5亿美元豪宅:select值的问题请教

来源:百度文库 编辑:中科新闻网 时间:2024/05/02 20:25:18
<select name=select1>
<option value=a>a</option>
<option value=b>b</option>
</select>
<script language=vbscript>
function go()
(在这里我如何得到select1所选中的值?)
end function
<script>

<select name=select1 id="sel1">
<option value=a>第一个</option>
<option value=b>第二个</option>
</select>
<script language="vbscript">
Function go()
msgBox(sel1.options(sel1.selectedIndex).value)
msgBox(sel1.options(sel1.selectedIndex).text)
End Function
</script>
<input type="button" onclick="go()" value="确定">

i=document.getElementById("select1").value

alert(i)