标签:
<html >
<head runat="server">
<title></title>
<style type="text/css">
#SiteStat
{
width: 97px;
height: 181px;
}
</style>
</head>
<body>
<from>
<script language=javascript>
function foo(){
//var i = 3;
var i = document.getElementById("ds").value;
o = document.getElementById("SiteStat");
for (c = 0; c < o.length; c++) {
dy = o.options[c].value.indexOf(i)
if(dy==0)
//if (o.options[c].value == i)
{
o.options[c].selected = true;
break;
}
}
}
</script>
<select name="SiteStat" multiple="multiple" class="select1" id="SiteStat">
<option value="-1" selected></option>
<option value="1" >状态A</option>
<option value="0">状态B</option>
<option value="22">状态C</option>
<option value="33">状态D</option>
</select>
</from>
<input type=‘text‘ name=‘olala‘ id=‘ds‘/>
<input type=‘submit‘ name=‘sub‘ value=‘查询显示‘ onclick="foo()"/>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/hzhs/p/5587370.html