62,046
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script>
function show()
{
obj = document.getElementById('DropDownList1');
for(i=0;i<obj.options.length;i++)
{
if(obj.options[i].selected)
{
window.open(obj.options[i].value);
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server" Width="88px" onchange="show()">
<asp:ListItem Text="请选择" Value="请选择"></asp:ListItem>
<asp:ListItem Text="百度" Value="http://www.baidu.com"></asp:ListItem>
<asp:ListItem Text="狗狗" Value="http://www.google.com"></asp:ListItem>
</asp:DropDownList> <br />
<br />
<br />
</div>
</form>
</body>
</html>