<style>
select {
width:80px;
padding:0px;
margin:0px;
background:#000;
color:#fff;
}
</style>
<script>
function ww() {
switch (document.form1.select1.value) {
case "" :
var pp=new Array("");
break;
case "a" :
var pp = new Array("1","1","2","2","3","3","4","4","5","5","6","6","7","7","8","8","9","9","10","10");
break;
case "b" :
var pp = new Array("11","11","12","12","13","13","14","14","15","15","16","16","17","17","18","18","19","19","20","20");
break;
}
document.form1.select2.options.length = 0;
for(var i = 0; i <pp.length/2; i++) {
document.form1.select2.options[i]=new Option(pp[i*2],pp[i*2+1]);
if (document.form1.select2.options[i].value=="")
document.form1.select2.selectedIndex =i;
}
}
function ee() {
for(var i = 0; i < document.form1.select1.options.length; i++) {
if (document.form1.select1.options[i].value=="")
document.form1.select1.selectedIndex = i;
}
ww();
}
onload=ee;
</script>
<body>
<form name="form1" method="post" action="" >
<select name="select1" onchange="ww()">
<option value="" selected="selected">请选译</option>
<option value="a">a</option>
<option value="b">b</option>
</select>
<select name="select2">
</select>
</form>
</body>
posted on 2006-03-28 23:23
汪杰 阅读(528)
评论(0) 编辑 收藏 引用 所属分类:
javascript