62,268
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_20120301_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
function SlectInfo()
{
var ddl = document.getElementById("<%=dropdownlist1.ClientID %>");
var ddlVal = ddl.options[ddl.selectedIndex].value;
alert(ddlVal);
}
</script>
<div>
<asp:DropDownList ID="dropdownlist1" runat="server">
<asp:ListItem Value="学习管理">学习管理</asp:ListItem>
<asp:ListItem Value="学习方法">学习方法</asp:ListItem>
<asp:ListItem Value="学习目标">学习目标</asp:ListItem>
</asp:DropDownList>
</div>
<div>
<a class="button" id="select" onclick="SlectInfo()" title="新增" runat="server"><span>
查询</span> </a>
</div>
</form>
</body>
</html>
var s = $("#dropdownlist1").val();
document.write(s);
var s = document.getElementById("dropdownlist1").options[window.document.getElementById("DropDownList1").selectedIndex].text;
document.write(s);