var selectObj = document.getElementById('selectId');
selectObj.options.length = 0;//清空
var child = new Option('name','value');//创建子选项,第一个参数为选择项名称,第二个为值
selectObj.options.add(child);//添加
selectObj.options[index] = null;//删除
select动态添加子选择项option
最新推荐文章于 2020-11-30 22:07:28 发布