JS 指定下拉框的值

来源:互联网 发布:姚明nba第一年数据 编辑:程序博客网 时间:2024/06/03 06:03
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JS 指定下拉框的值</title>
<script>
window.onload = function start(){
//index 从0开始
document.getElementById("s").selectedIndex = "2";
}
</script>
</head>
<body>
<select id="s">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
</body>
</html>
原创粉丝点击