怎样对的选项做自定义选择?
想对<select>的选项做动态选择,而不一定是地一项,比如我要选择第4项,
我下面用了两种方法select1都没反应。怎样对<select>的选项做自定义选择?
<html>
<head>
<title></title>
<script language=javascript>
function change()
{
select1.selectedIndex="3";
}
</script>
</head>
<body onload="change();">
<form id="from1" name="from1">
<select id="select1" name="select1">
<option value="1">1111</option>
<option value="2">2222</option>
<option value="3">3333</option>
<option value="4">4444</option>
</select>
<br>
href="#" onclick="change();">change</a>
</form>
</body>
</html>