|
其實(shí)想要獲取到下拉框的值是很簡(jiǎn)單的。
最關(guān)鍵的一段代碼就是:
復(fù)制代碼 代碼如下:
onchange="show(this.options[this.options.selectedIndex].value);"
onchange="show(this.options[this.options.selectedIndex].value);"
show是一個(gè)自定義的函數(shù)名。
this.options[this.options.selectedIndex].value才是主角!
JavaScript技術(shù):javascript 獲取select下拉列表值的代碼,轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。