zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    VC++ MFC应用程序项目文件2.cpp
    sql存储过程加密和解密(MSSQL)
    VC++ MFC应用程序项目文件
    vs 2017 正规表达式替换整行多行数据
    mysqli
    jQuery对象
    Solidworks如何等比例缩小放大模型
    大负载机器人为什么要用平衡缸
    Office 如何下载网页的视频 JWPlayer的内嵌视频
    Solidworks如何自动打开和关闭特征识别FeatureWorks
  • 原文地址:https://www.cnblogs.com/ricky_li/p/3756987.html
Copyright © 2011-2022 走看看