代码没有预想的效果 高手帮忙看看啊
<body>
<form method= "post " action= " " name= "form1 ">
<input type= "radio " name= "ddfind " checked= "checked " id= "radio1 " onclick= "check() "/>
<input type= "radio " name= "ddfind " id= "radio2 " onclick= "check() "/>
</form>
<div id= "Layer1 " style= "display:block; background:#00FFFF "> 层1 </div>
<div id= "Layer2 " style= "display:none; background:#CCCCCC "> 层2 </div>
<script language= "javascript ">
function check(){
var find = document.form1;
if(find.radio1.checked==true){
Layer1.style.display= "block ";
}
else if(find.radio2.checked==true){
Layer2.style.dispale= "block ";
}
}
</script>
</body>
要点不同的单选框出现不同的蹭, 那个大虾知道帮帮忙
------解决方案--------------------if(find.radio1.checked==true){
Layer1.style.display= "block ";
Layer2.style.display= "none ";
}
else if(find.radio2.checked==true){
Layer1.style.display= "none ";
Layer2.style.display= "block ";
}
------解决方案--------------------楼上的回答应该就是正解
------解决方案--------------------onclick= "Layer1.style.display= 'block ';Layer2.style.display= 'none '; "
onclick= "Layer1.style.display= 'none ';Layer2.style.display= 'block '; "
------解决方案--------------------学习
本想提问的,刚好有类似的问题,省了分数了。