html <select> 用JS控制默认选中项

<html> 
<head>
<!--禁止页面缓存-->
<
meta http-equiv="content-type" content="text/html;charset=utf-8" /> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="0"> </head> <select id="ss"> <option >aa0</option> <option >aa1</option> <option >aa2</option> <option >aa3</option> </select> <body> <script > var ss = document.getElementById('ss'); ss[3].selected = true;//选中 </script> </html>

 

posted @ 2016-05-14 13:00  孤舟残月浅笑嫣然  阅读(28364)  评论(0编辑  收藏  举报