首页 > 其他 > 详细

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

时间:2018-12-25 00:23:35      阅读:185      评论:0      收藏:0      [点我收藏+]

转自:https://blog.csdn.net/pt_sm/article/details/53521560

方法一 

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


方法二 

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


方法三 

document.getElementById("selectid").innerHTML = ""; 不知道为了什么,只有这个方法三灵
方法4:
document.getElementById("selectid").Empty()

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

原文:https://www.cnblogs.com/sharpest/p/10171693.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!