1、清空select所有option项
document.getElementById("sel1").length=0;2、循环option项,逐个删除
function clearn(){
var ctrl2=document.getElementById("id");
for(var i=0;i<ctrl2.options.length;) {
ctrl2.removeChild(ctrl2.options[i]);
}
}
jquery清除select控件的所有option项 1、清空select所有option项 document.getE…
1、清空select所有option项
document.getElementById("sel1").length=0;2、循环option项,逐个删除
function clearn(){
var ctrl2=document.getElementById("id");
for(var i=0;i<ctrl2.options.length;) {
ctrl2.removeChild(ctrl2.options[i]);
}
}