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

Laura ·
更新时间:2024-09-21
· 807 次阅读

方法一

代码如下:
document.getElementById("selectid").options.length = 0;

方法二

代码如下:
document.formName.selectName.options.length = 0;

方法三

代码如下:
document.getElementById("selectid").innerHTML = "";



select option

需要 登录 后方可回复, 如果你还没有账号请 注册新账号