javascript 获取DropDownList选定值的方法

 

<script type="text/javascript" language="javascript">

     function submitData() {
         var d = document.getElementById("<%=DropDownList1.ClientID %>");//根据DropDownList的客户端ID获取该控件
         var typeValue = d.options[d.selectedIndex].value;//获取DropDownList当前选中值
         alert(typeValue);//测试
        
         }
     }
  
    </script>

posted @ 2017-08-23 19:17  caiyajun  阅读(295)  评论(0)    收藏  举报