纪录备忘:应用中的脚本应用
--1.服务器端的下拉框
<asp:DropDownList ID="ddlSelectLineType" runat="server" Width="50" ></asp:DropDownList>
在脚本中得到服务器端的下拉框的脚本代码:
var first = $("ddlSelectLineType").value;
--2.服务器端的RadioButtonList
<asp:RadioButtonList ID="rblLineType" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" onclick="changeType();">
<asp:ListItem Text="组1" Value="0" Selected="True"></asp:ListItem>
<asp:ListItem Text="散2" Value="1"></asp:ListItem>
</asp:RadioButtonList>
脚本代码:
function changeType()
{
var test=document.getElementsByName("rblLineType");
for(var i=0;i<test.length;i++){
if(test[i].checked){
if(test[i].value == "1"){
alert('散2!');
}
}
}
只是用于纪录备忘.