js 操作select和option(转载)
摘要:
1.动态创建selectfunction createSelect(){var mySelect = document.createElement("select"); mySelect.id = "mySelect"; document.body.appendChild(mySelect); }2.添加选项optionfunction addOption(){//根据id查找对象, var obj=document.getElementById('mySelect');//添加一个选项obj.add(new Option(". 阅读全文
posted @ 2011-09-08 16:55 于小栋 阅读(300) 评论(0) 推荐(0) 编辑