<html>
<title>testpage</title>
<head>
<style>
//style="overflow-y:hidden;overflow-x:hidden";
</style>
<script language="javascript" type="text/javascript">
function chg(){
//var id=document.getElementById("showpage").value
if(document.form1.slt.value=="11111"){
document.getElementById("showpage").style.display="";
document.getElementById("showit").style.display="";
}
if(document.form1.slt.value=="22222"){
document.getElementById("showpage").style.display="none";
document.getElementById("showit").style.display="none";
}
if(document.form1.slt.value=="33333"){
document.getElementById("showpage").style.display="";
}
if(document.form1.slt.value=="55555"){
document.getElementById("showit").style.display="none";
}
}
</script>
</head>
<body>
<form action="#" name="form1" method="post">
<select name="slt" οnchange="chg()">
<option>please select</option>
<option value="11111">11111</option>
<option value="22222">22222</option>
<option value="33333">33333</option>
<option value="44444">44444</option>
<option value="55555">55555</option>
</select>
<br />
<input name="showpage" type="text" value="this is a test page" style="display:none;border-left:0px;border-top:0px;border-right:0px;border-bottom:1px solid #ff0000 " />
<div id="showit">good for you</div>
</form>
</body>
</html>
下拉列表onchange事件
最新推荐文章于 2021-06-08 18:37:06 发布