利用单选按钮控制层的出现
<script language= "javascript ">
function change_view(obj_name1,obj_name2)
{
var aa=document.getElementById(obj_name1);
aa.style.display= " ";
var bb=document.getElementById(obj_name2);
bb.style.display= "none ";
}
</script>
<div id= "up1 " style= "display:none; "> 1 </div>
<div id= "up2 " style= "display:none; "> 2 </div>
<input type= "radio " value= "shao " name= "radio " onclick= "javascript:change_view( 'up1,up2 '); " />
<input type= "radio " value= "duo " name= "radio " onclick= "javascript:change_view( 'up2,up1 '); " />
想达到的目的是点击单选按钮1,up1出现,up2隐藏,点击单选按钮2,up1隐藏,up2出现
这样写运行时出错,谁帮忙看看。
------解决方案--------------------change_view( 'up1 ', 'up2 ')
另一个同理
------解决方案--------------------javascript:change_view( 'up1 ', 'up2 ');