JS 中动态添加 select 的option 方法

关键是大小写问题,由于大小写问题,导致犯了错误

代码如下:

1     for (var i = 0; i < vallist.length; i++) {
2         document.getElementById("selmon").options.add(new Option(vallist[i],i+1));
3     }
View Code

 

posted @ 2017-06-07 10:38  黑二胖  阅读(1485)  评论(0编辑  收藏  举报