动态删除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
猜你喜欢
转载自blog.csdn.net/cch5487614/article/details/5711903
今日推荐
周排行