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

怎么读取option属性值

2012-03-02 
如何读取option属性值?我在网页中添加一个下拉选择框:selectstyle width:85% name aDDeptoptionval

如何读取option属性值?
我在网页中添加一个下拉选择框:
            <select   style= "width:85% "   name= 'aDDept '   >
                <option   value= "A "   label= "通用类 "   title= "通用类 "> 通用类 </option>
                <option   value= "B "   label= "办公厅 "   title= "办公厅 "> 办公厅 </option>
            </select>
        想将其中的label或者title的值度曲出来,其实也就是想将“通用类”和“办公厅”与对应的“A”、“B”一起提取出来。
        想知道怎么实现,先谢谢了,在线等,QQ:39799211


[解决办法]
aDDept[aDDept.selectedIndex].value
aDDept[aDDept.selectedIndex].label
aDDept[aDDept.selectedIndex].title

热点排行