方法一
document.getElementById("selectid").options.length = 0;
方法二
document.formName.selectName.options.length = 0;
方法三
document.getElementById("selectid").innerHTML
= "";
本文介绍了在JavaScript中清除元素下拉菜单选项的三种方法:通过getElementById方法、formName方法和innerHTML属性实现。提供了详细的代码示例。
方法一
document.getElementById("selectid").options.length = 0;
方法二
document.formName.selectName.options.length = 0;
方法三
document.getElementById("selectid").innerHTML
= "";
3725
1148

被折叠的 条评论
为什么被折叠?