js 控制div的显示
<html>
<meta http-equiv="content-type" content="text/html;charset=utf-8;"/>
<head><TITLE>测试</TITLE>
<script>
function sel(){
if(document.myForm.divList.value==1)
{
document.getElementById("div1").style.display="";
document.getElementById("div2").style.display="none";
}
if(document.myForm.divList.value==2)
{
document.getElementById("div2").style.display="";
document.getElementById("div1").style.display="none";
}
}
</script>
</head>
<body>
<form name="myForm">
<select name="divList" οnchange="sel()">
<option value="1">hello</option>
<option value="2">world</option>
</select>
<div id="div1" style="display:none;">
<label>my div1</label>
</div>
<div id="div2" style="display:none;">
<label>my div2</label>
</div>
</form>
</body>
</html>