js添加和删除dropdownlist的值

删除

var ddl = document.getElementById("ddlGroup");
for (var j = 0; j < ddl.options.length; j++) {
       if (ddl.options[j].value == "") {
            ddl.options.remove(j);
            break;
      }
 }

添加

var ddl = document.getElementById("ddlVoice");
ddl.options.add(new Option("text","value"));
原文地址:https://www.cnblogs.com/dreamshallow/p/3359362.html