firefox下可以动态添加select的option吗?
|
admin
2013年7月5日 8:15
本文热度 8515
|
firefox下可以动态添加select的option吗?
var opt = document.createElement("option");
opt.text = "文本";
opt.value = "值";
document.getElementById("mySelectId").add(opt);
以上脚本在IE下可以,在firefox下不提示错误,也没效果
还是不行
该文章在 2013/7/5 8:15:28 编辑过
| |
全部评论1 |
|
admin
2013年7月5日 8:15
可以动态添加,试试document.getElementById(\"mySelectId\").appendChild(opt); 该评论在 2013/7/5 8:15:42 编辑过
|