[問題] select的選中項要怎麼變更?
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
document.form.select.options[0].selected=true;
alert("");
</script>
</head>
<body>
<form name="form">
<table>
<select name="select">
<option value="100">100</option>
<option value="0">0</option>
<option value="2">2</option>
<option value="50" selected="selected">50</option>
</select>
</table>
</form>
</body>
</html>
沒有作用,選定項還是50,請問我哪裡寫錯了?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.66.86.158
→
04/14 17:14, , 1F
04/14 17:14, 1F
→
04/14 17:14, , 2F
04/14 17:14, 2F
※ 編輯: lakegreen 來自: 210.66.86.158 (04/14 17:15)
推
04/14 17:20, , 3F
04/14 17:20, 3F
→
04/14 17:26, , 4F
04/14 17:26, 4F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章