<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>
javascript设置
下拉列表的默认值 - www.osxue.com</title>
</head>
<body>
<select name="actorname" id="actor">
<option value="all">全部</option>
<option value="bj">北京</option>
<option value="hjyy">系统学堂</option>
<option value="kjyy">www.osxue.com</option>
<option value="ljyy">www.jb200.com</option>
</select>
</body>
<script>
function selectValue(sId,value){
var s = document.getElementById(sId);
var ops = s.options;
for(var i=0;i<ops.length; i++){
var tempValue = ops[i].value;
if(tempValue == value)
{
ops[i].selected = true;
}
}
}
selectValue('actor','hstf');
</script>
</html>