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


方法一

复制代码
代码如下:

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

方法二

复制代码
代码如下:

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

方法三

复制代码
代码如下:

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

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3