首页 > Web开发 > 详细

JS获取DropDownList的value值与text值

时间:2014-05-30 04:53:20      阅读:343      评论:0      收藏:0      [点我收藏+]
<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>

JS获取DropDownList的value值与text值,布布扣,bubuko.com

JS获取DropDownList的value值与text值

原文:http://www.cnblogs.com/ricky_li/p/3756987.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!