清空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 =
文章正文
方法一
document.getElementById("selectid").options.length = 0;
方法二
document.formName.selectName.options.length = 0;
方法三
document.getElementById("selectid").innerHTML = "";
复制代码
代码如下:document.getElementById("selectid").options.length = 0;
方法二
复制代码
代码如下:document.formName.selectName.options.length = 0;
方法三
复制代码
代码如下:document.getElementById("selectid").innerHTML = "";
代码注释