清空select标签中option选项的4种不同方式

来源:互联网 发布:数据gap是什么意思 编辑:程序博客网 时间:2024/05/17 22:09
方法一
document.getElementById("selectid").options.length = 0; 

方法二
document.formName.selectName.options.length = 0; 

方法三
document.getElementById("selectid").innerHTML = ""; 不知道为了什么,只有这个方法三灵
方法4:
document.getElementById("selectid").Empty()
0 0
原创粉丝点击