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 @ 2010-04-27 22:04  玄魂  阅读(3796)  评论(0编辑  收藏  举报