var tb=document.getElementById("DropDownList1").value;

解决方案 »

  1.   

    document.getElementById("ddUser").options[document.getElementById("ddUser").selectedIndex].value仅供参考
      

  2.   

    去不出来啊!var tb=document.getElementById("DropDownList1").value;
      

  3.   

    function Button2_onclick() {
    function Button1_onclick() {
    var y=document.getElementById("DropDownList1").options[document.getElementById("DropDownList1").selectedIndex].value
    window.alert(y);
    }</script>    <asp:DropDownList ID="DropDownList1" runat="server" Height="22px" Width="79px">
        </asp:DropDownList><input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" />老师提示错误.!不知道为什么?
      

  4.   

    <input id="Button1" type="button" value="button" language="javascript" onclick="return Button1_onclick()" />是不是这里有问题,lz
      

  5.   

    getElementById要看HTML页面的id为准
      

  6.   

    这个是对的:document.getElementById("DropDownList1").options[document.getElementById("DropDownList1").selectedIndex].value
      

  7.   

    var _index = document.getElementById("DropDownList1").selectedIndex
    var _value = document.getElementById("DropDownList1").options[_index].value
    var _text = document.getElementById("DropDownList1").options[_index].text可以得到, 列表任意项的值, 和显示文本