• JS获取DropDownList的value值与text值


    <script type="text/javascript" language="javascript">
        function SearchChange()
        {
            var ddl = document.getElementById('<%=DropDownList1.ClientID %>')   
            var index = ddl.selectedIndex;   
             
            var Value = ddl.options[index].value;   
            var Text = ddl.options[index].text;
            
            alert(Value);
        }
        </script>
    <asp:DropDownList ID="DropDownList1" runat="server" onchange="SearchChange();">
        <asp:ListItem Value="0">111</asp:ListItem>
        <asp:ListItem Value="1">222</asp:ListItem>
        <asp:ListItem Value="2">333</asp:ListItem>
    </asp:DropDownList>
  • 相关阅读:
    FTP命令行工具NCFTP
    XP 通过无线网卡 建立对等网
    Silverlight WCF 压缩
    EntityFramework Linq查询
    UCS2编码转换C#
    C#7Z压缩
    c#公钥加密私钥解密和验证
    SVN global ignore pattern for c#
    典型的DIV CSS三行二列居中高度自适应布局
    VC#窗体的大小设置
  • 原文地址:https://www.cnblogs.com/ricky_li/p/3756987.html
Copyright © 2020-2023  润新知