请问如何用javascript获取asp.net中的DropDownList的value值

解决方案 »

  1.   


    var s=document.getElementById('<%=DropDownList1.ClientID %>').value;
    alert(s);
      

  2.   

    document.getElementById('DropDownList1').options[document.getElementById('DropDownList1').selectedIndex].value如果想得到text值
    document.getElementById('DropDownList1').options[document.getElementById('DropDownList1').selectedIndex].text
      

  3.   

    document.getElementById("dropdownlist1")[document.getElementById("dropdownlist1").selectedIndex].text
      

  4.   

    直接document.form1.dropdownlist1.value获得的是text值
      

  5.   

    document.getElementById('id').options[document.getElementById('id').selectedIndex].value