通过修改select的value值
1 <input type="button" id="btn" value="按钮"/> 2 <select name="select" id="select"> 3 <option value="1">aa</option> 4 <option value="a">bb</option> 5 <option value="c">cc</option> 6 </select> 7 <script type="text/javascript"> 8 //点击按钮,让第二项选中 9 document.getElementById('btn').onclick=function(){ 10 document.getElementById('select').value="a"; 11 } 12 </script>
耐得住寂寞,才能登得顶
Gitee码云:https://gitee.com/lyc96/projects