当前位置: 代码迷 >> Web前端 >> 上拉框 select 属性方法
  详细解决方案

上拉框 select 属性方法

热度:78   发布时间:2012-11-03 10:57:44.0
下拉框 select 属性方法
当前选择项的索引:selectedIndex
删除选中的选项:remove(selIndex);
移动option : oListboxTo.appendChild(oOption)
添加option: selectedObjs.options.add(new Option(code[j],code[j]));
取得value 值:oListbox.options[i].getAttribute("value");
取得索引值:oListbox.options[i].index
改项是否被选中:if(oListbox.options[i].selected)
获取select集合的元素个数长度长度:  oListbox.options.length
  相关解决方案