代码如下:
<script>
//普通js写法
document.getElementById("select_id").options[1].setAttribute("selected", true);
//jquery应该这样写
$("#select_id option").eq(1).attr("selected",true);
</script>
本文由 SAn 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为:
2017/06/28 17:31