a和b是什么啊,没定义
你在radio里onclick那就一定是checked了,不要判断了,我想楼主应该是想实现下面的情况
<input name=a>
<input name=b type=checkbox style="display:none">
<input name="RadioGroup1" type="radio" onClick="document.getElementById('a').style.display='';document.getElementById('b').style.display='none';" checked><input type="radio" name="RadioGroup1" onClick="document.getElementById('b').style.display='';document.getElementById('a').style.display='none';">

解决方案 »

  1.   

    就是啊,你把自己想干什么说出来别人才能跟你说,你是不是想用一个radio来控制另外一个对象的显示,而且两外两个对象只能显示一个?如果是的话那就这样
    <font id='a'>a</font><br>
    <font id='b'>b</font><br><input name="RadioGroup1" type="radio" onClick="if(this.checked==true){ a.style.display='';b.style.display='none'};"checked><input type="radio" name="RadioGroup1" onClick="if(this.checked==true){ a.style.display='none';b.style.display=''};">