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>
  • 相关阅读:
    聊聊自动化的打开方式
    浅谈如何提高自动化测试的稳定性和可维护性 (pytest&allure)
    Jmeter做压力测试的心得
    为什么测试人员必须掌握Linux?
    数据结构与算法系列 目录
    高可用高性能分布式文件系统FastDFS进阶keepalived+nginx对多tracker进行高可用热备
    Fastdfs文件系统扩容
    Linux下FastDFS分布式存储-总结及部署记录
    How to setup a Alpine Linux mirror
    修改内核参数开启转发
  • 原文地址:https://www.cnblogs.com/ricky_li/p/3756987.html
Copyright © 2011-2022 走看看