<html>
<script language="javascript"> 
function showDiv(){
if(select1.value=="1"){
div1.style.display="block";
}else{
div1.style.display="none";
}
}
</script>        <body> 
<div id="div1" style="background-color:blue;width:100px;height:100px;position:absolute;top:100px;left:300px;display:none;"></div>
<select id="select1" onchange="showDiv()">
<option value="2">2</option>
<option value="1">1</option>
<option value="3">3</option>
</select>
</body>
</html>

解决方案 »

  1.   

    看是不是你想要的:<form id="form1" name="form1" method="post" action="">
      <select name="s" id="s" onchange="if(this.value==1) document.getElementById('xx').style.display='block'; else document.getElementById('xx').style.display='none';">
        <option value="2">2</option>
        <option value="1">1</option>
      </select>
    </form>
    <div style="display:none" id="xx">这里是要显示的层</div>