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

内容摘要
方法一

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

方法二

复制代码代码如下:
document.formName.selectName.options.length =
文章正文
方法一

复制代码
代码如下:

document.getElementById("selectid").options.length = 0;

方法二

复制代码
代码如下:

document.formName.selectName.options.length = 0;

方法三

复制代码
代码如下:

document.getElementById("selectid").innerHTML = "";

代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!