<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head><body>
<input type="radio" name="ck" value="1"  />ra1
<input type="radio" name="ck" value="2"  />ra2<input type=button onclick=document.all.ck[0].checked=true>
<input type=button onclick=document.all.ck[1].checked=true>
</body></html>

解决方案 »

  1.   

    楼上的方法没错,就是document.all在兼容性方面会有问题,只能在IE下使用
    稍微修改一下就可以了
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head><body>
    <input type="radio" name="rk" value="aaa" />1
    <input type="radio" name="rk" value="bbb" />2
    <input type="button" value="选择1" onclick="document.getElementsByName('rk')[0].checked = true;" />
    <input type="button" value="选择2" onclick="document.getElementsByName('rk')[1].checked = true;" />
    </body>
    </html>