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>
  • 相关阅读:
    Django 两张表的正向查找和反向查找
    表结构基类写法
    vue绑定用户页面--新浪
    新浪微博绑定用户接口
    vue新浪微博回调空页面
    新浪微博回调接口
    vue获取授权url
    Android AsyncTask完全解析,带你从源码的角度彻底理解
    Android 3D滑动菜单完全解析,实现推拉门式的立体特效
    Android中轴旋转特效实现,制作别样的图片浏览器
  • 原文地址:https://www.cnblogs.com/ricky_li/p/3756987.html
Copyright © 2011-2022 走看看