當(dāng)前位置:
首頁(yè) >
前端技术
> javascript
>内容正文
javascript
javascript 获取DropDownList选定值的方法
生活随笔
收集整理的這篇文章主要介紹了
javascript 获取DropDownList选定值的方法
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
<script type="text/javascript" language="javascript">
???? function submitData() {
???????? var d = document.getElementById("<%=DropDownList1.ClientID %>");//根據(jù)DropDownList的客戶端ID獲取該控件
???????? var typeValue = d.options[d.selectedIndex].value;//獲取DropDownList當(dāng)前選中值
???????? alert(typeValue);//測(cè)試
????????
???????? }
???? }
??
???? function submitData() {
???????? var d = document.getElementById("<%=DropDownList1.ClientID %>");//根據(jù)DropDownList的客戶端ID獲取該控件
???????? var typeValue = d.options[d.selectedIndex].value;//獲取DropDownList當(dāng)前選中值
???????? alert(typeValue);//測(cè)試
????????
???????? }
???? }
??
??? </script>
本文轉(zhuǎn)自懸魂博客園博客,原文鏈接:http://www.cnblogs.com/xuanhun/archive/2010/04/27/1722416.html,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的javascript 获取DropDownList选定值的方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python 3 并发编程多进程之进程同
- 下一篇: 可输入可下拉的输入选择框