87,997
社区成员




var tt = document.forms[0].mselect;//mselect为下拉框的名字
var uu = tt.selectedIndex;
tt.options.remove(uu);
var selObj = document.forms[0].testName;
var selIndex = selObj.selectedIndex;
if(selIndex!=-1){
selObj.options.remove(selIndex);//只要一执行这句,jsp页面是上的下拉框就显示,就跟隐藏了一样
}
selObj.options[selIndex].removeNode(true);//这样在jsp里面有能行。这是为什么呢?
更正下
var selObj = document.forms[0].testName;
var selIndex = selObj.selectedIndex;
if(selIndex!=-1){
selObj.options.remove(selIndex);//只要一执行这句,jsp页面是上的下拉框就消失,就跟隐藏了一样
//本来应该是执行到这句,选中的那个值应该删除,可是它整个下拉框都消失了。
}