1、 JavaScript
var oSel=document.form1.DropDownCity;
while(oSel.options.length>0){
oSel.removeChild(oSel.options[0]);
}
2、 JavaScript
<SCRIPT LANGUAGE="JavaScript">
function del1(){
var obj = document.getElementById("s");
var count = obj.options.length;
for(var i = 0;i<count;i++){
obj.options.remove(0);//每次删除 下标都是0
}
}
</SCRIPT>
3、 JavaScript
<script language="javascript">
function del() {
for (var i = s.options.length - 1; i >= 0; i --)
s.options[i] = null;
}
</script>
4、 JavaScript
<SCRIPT LANGUAGE="JavaScript">
function del1(){
var obj = document.getElementById("s");
obj.options.length=0
}
</SCRIPT>
var oSel=document.form1.DropDownCity;
while(oSel.options.length>0){
oSel.removeChild(oSel.options[0]);
}
2、 JavaScript
<SCRIPT LANGUAGE="JavaScript">
function del1(){
var obj = document.getElementById("s");
var count = obj.options.length;
for(var i = 0;i<count;i++){
obj.options.remove(0);//每次删除 下标都是0
}
}
</SCRIPT>
3、 JavaScript
<script language="javascript">
function del() {
for (var i = s.options.length - 1; i >= 0; i --)
s.options[i] = null;
}
</script>
4、 JavaScript
<SCRIPT LANGUAGE="JavaScript">
function del1(){
var obj = document.getElementById("s");
obj.options.length=0
}
</SCRIPT>
removeOption 在ie中的用法
function removeOption(index)
- {
- document.getElementById("selUnassignedUsers").options.remove(index);
- }
removeOption 在FF中的用法- function removeOption(index)
- {
- document.getElementById("selUnassignedUsers").remove(index);
- }