首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

DropDownList 绑定了value 和 text,用js :document.getElementById("DropDownList2&q

2012-02-07 
DropDownList 绑定了value 和 text,用js:document.getElementById(DropDownList2).value 可以取出value

DropDownList 绑定了value 和 text,用js :document.getElementById("DropDownList2").value; 可以取出value ,选中项的text 怎么取啊? - Web 开发 / Ajax
document.getElementById( "DropDownList2 ").text   不行!

[解决办法]
document.getElementById( "DropDownList2 ").options[i].text取Text属性
document.getElementById( "DropDownList2 ").options[i].value取Value属性

热点排行