您当前所在位置:首页 > 网页制作 > HTML/Xhtml
HTML/Xhtml
清空select标签中option选项的3种不同方式
本文为大家详细介绍下使用3种不同方式来清空select标签中option选项,具体语法格式如下,感兴趣的朋友可以参考下哈,希望对大家有所帮助
方法一
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 = "";
很赞哦!()
大图广告(830*140)