+ -
当前位置:首页 → 问答吧 → 为什么为我用 remove 先移除 select 中的 options 时 select都删除了

为什么为我用 remove 先移除 select 中的 options 时 select都删除了

时间:2010-12-10

来源:互联网

为什么为我用 remove 先移除 select 中的 options 时 select都删除了 
就删一个下拉选项,结果整个下拉的框框都被删除了
这是为什么

我的操作是这样
x = document.getElementById("");
先是用JS的new Option()在空的select里添加三个option  
x.options[length] = new Option(text,value); 

到位第三个时,用js的 remove移除第三个
x.remove(x.selectedIndex)

结果整个框框都没有了


求救,求解

作者: wdvill   发布时间: 2010-12-10

来帮我看下啊

作者: wdvill   发布时间: 2010-12-11

热门下载

更多