动态删除select中的所有options:
function deleteAllOptions(sel){
sel.options.length=0;
}
动态删除select中的某一项option:
function deleteOption(sel,indx){
sel.options.remove(indx);
}
动态添加select中的项option:
function addOption(sel,text,value){
sel.options.add(new Option(text,value));
}
js操作select 兼容ie、chrome、Firefox
最新推荐文章于 2022-01-20 17:48:59 发布